Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Virginia
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If ststement problem

    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?

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If ststement problem

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

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If ststement problem

    If your field names are "Department" and "Audit Type", the following should work:
    <pre>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
    </pre>

    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

Posting Permissions

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