• If ststement problem

    Author
    Topic
    #356478

    I am trying to open a second form if the correct values are in the “department” and “Audit Type” fields on the first form with the following code:

    Private Sub Audit_Type_AfterUpdate()
    If “Department = BND” And “Audit Type = First Piece” Then
    DoCmd.OpenForm “frmEnterBNDFirstPieceStatus”, acNormal

    Else
    End If
    End Sub

    Can’t get this to work. Any help?

    Viewing 1 reply thread
    Author
    Replies
    • #527695

      have you tried
      If Department = “BND” And [Audit Type] = “First Piece” Then
      HTH

    • #527698

      If your field names are “Department” and “Audit Type”, the following should work:

      Private Sub Audit_Type_AfterUpdate()
      If Me.Department = "BND" And Me.Audit_Type = "First Piece" Then
          MsgBox "Yup"
      Else
          MsgBox "Nope"
      End If
      End Sub
      
    Viewing 1 reply thread
    Reply To: If ststement problem

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: