• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Open form with Where Condition Or Statement

Experts,

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

Thanks...
0
pdvsa
Asked:
pdvsa
1 Solution
 
NorieCommented:
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

0
 
pdvsaAuthor Commented:
perfect...thanks...
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now