Where Condition (1 Viewer)

LynnaM

Registered User.
Local time
Today, 06:48
Joined
May 11, 2001
Messages
19
I am currently using this code DoCmd.OpenReport stDocName, acViewPreview, , "Desc = '" & Desc & "'" in a report to print preview only where the Desc matches the form to the report but I want to add another condition, example PartNo. Can anyone help me out? I have looked at my SQL statement but I can not make heads or tails of it. Ofcourse I am a beginner with coding and I know this is probably a very idiotic question but I need help.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:48
Joined
Feb 19, 2002
Messages
43,484
Add the additional condition to the OpenReport statement:

DoCmd.OpenReport stDocName, acViewPreview, , "Desc = '" & Desc & "' AND PartNo = '" & PartNo & "'"
 

LynnaM

Registered User.
Local time
Today, 06:48
Joined
May 11, 2001
Messages
19
Thank you so much. That was exactly what I needed.
 

Users who are viewing this thread

Top Bottom