Multiple criteria in where clause to open a form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HiGu
    New Member
    • Feb 2012
    • 99

    Multiple criteria in where clause to open a form?

    Is the following statement correct/
    Code:
    DoCmd.OpenForm Me.Name, , , "[A_PRIORITY] = '" & _ cboPrior & "'" AND "[A_LOCATION] = '" & _ cboLocate & "'"
    I am trying to give two conditions to open a form here.However nothing happens.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    No. It has various problems, mainly related to what is inside, and what is outside, your string values.

    Try something like :
    Code:
    Call DoCmd.OpenForm(FormName:=Me.Name, _
                        WhereCondition:="([A_PRIORITY] = '" & Me.cboPrior & "') AND " & _
                                        "([A_LOCATION] = '" & Me.cboLocate & "')")

    Comment

    Working...