Link to home
Start Free TrialLog in
Avatar of Stephen Byrom
Stephen ByromFlag for Ireland

asked on

Multi Where clause

Hi,
I am trying to open a report based on a where clause depending on what the user selects in an optionframe on a form.

I have looked through here and google but I am getting more and more confused.
It works if I select an option with a single number behind it, but not with the two numbers. (the numbers are primary keys for the customers).

Any help is appreciated.
Thanks
Dim strWhere As String
Dim Cust As Integer

Select Case Me.frameProdGroup
    Case 1
        Cust = 300 Or 169
    Case 2
        Cust = 444 Or 329
    Case 3
        Cust = 238
    Case 4
        Cust = 220
    Case 5
        Cust = 235
    Case 6
        Cust = 180
End Select

strWhere = "[fkCustID] = " & Cust
DoCmd.OpenReport "rptStoxBase", acViewReport, , strWhere

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stephen Byrom

ASKER

Perfect!
Thanks for your time, you've saved me loads
glad I could help.

Happy New Year!