By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

Multiple criterias in VBA Access

P: 1
How would one write a code to open a report (from a form) with 2 criterias.

1.)Retrieves data according to a combo box (I'm good on that one)

AND

2.)Is according to a specific data within a field in a table.

For example.

car - 1
truck - 2
car - 3
bus - 4
car - 5
truck - 6
car - 7
truck - 8
car - 9

I want to bring up the numbers only for say a "car".

how would I write the codes in that manner?
Oct 16 '07 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,315
How would one write a code to open a report (from a form) with 2 criterias.

1.)Retrieves data according to a combo box (I'm good on that one)

AND

2.)Is according to a specific data within a field in a table.

For example.

car - 1
truck - 2
car - 3
bus - 4
car - 5
truck - 6
car - 7
truck - 8
car - 9

I want to bring up the numbers only for say a "car".

how would I write the codes in that manner?
Are you able to do both separately but looking for a way to combine them?
You would use the AND operator.

Expand|Select|Wrap|Line Numbers
  1. "SomeField='" & Me.cboName & "' AND VehicleType='Car'"
  2.  
Oct 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.