Open form with Where Condition Or Statement


I have been fiddling with this Or Statement in the following event.  I have no problem with 1 where statement but when I add " OR 178 OR 179" Where condition I have issues (Runtime error 13:  Type Mismatch).  I am sure I have the syntax wrong in the below Where "OR" conditions

Private Sub cmdAddbank_Click()

    DoCmd.OpenForm "frmLCIssued_Sum", , , "[BankID]= 1" Or "[BankID]= 178" Or "[BankID] = 179", , acDialog
End Sub

pdvsaProject financeAsked:
Who is Participating?
NorieConnect With a Mentor VBA ExpertCommented:
Try this.
"[BankID]= 1 Or [BankID]= 178 Or [BankID]=179"

Open in new window

Or this.
"[BankID] In (1,178,179)"

Open in new window

pdvsaProject financeAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.