Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2013
    Posts
    17

    Unanswered: Form_Deactivate() Problem

    All I want to do, is require to fill one control in subform in my form "FrmZlecenia".
    It is not simple because, I'm using overlap to navigate between active Forms.
    I wrote some code, but it works every other time and I don't know why.
    Is there anyone who can help me with this?
    With this code if user doesn't fill control "nazwa" and goes to another form which is open, the code will move view and focus to "frmZlecenia" form. But it works every other time - This is really strange
    Code:
    Form_Deactivate()
    If Len(Nz(Forms!frmZlecenia!frmGoraZlecenia.Form!Nazwa)) = 0 Then
    If MsgBox("Please fill 'Nazwa'", vbOKOnly, "notice") = vbOK Then
    
    DoCmd.OpenForm "FrmZlecenia"
    Forms!frmZlecenia!frmGoraZlecenia.Form!Nazwa.SetFocus
    End If
    End If
    end sub

  2. #2
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    What event does this code run on?
    Regards
    JD

    Software-Matters

  3. #3
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Please ignore the previous post but I'm wondering if all you want to do is make sure a field is filled out then there are many ways to do this. One way would be to make the field compulsory in the table by selecting Required = Yes.
    Regards
    JD

    Software-Matters

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •