473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Multiple criterias in VBA Access

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
1 1356
Rabbit
12,516 Expert Mod 8TB
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

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

Similar topics

4
by: herbert | last post by:
1) I created a class Person whose objects are stored in collections. Using IComparable allows to define one sort criteria like name. Best practice: How can I add more sort criterias like age, zip,...
1
by: smita | last post by:
Hi, I want to search an xml file for particular searchstrings and also based on the date i.e. all items containing the date -----prior to the specified date, or ----on that date or ----- after the...
2
by: Rik Brooks | last post by:
My boss has put a couple of restraints on me that has me tearing out my hair. Here is my problem. On a particular asp page I need to use server side controls so that I do some fairly complex...
3
by: Jesper Jensen | last post by:
I have the following problem: I have created the following SQL for my app. With the below shown code (Example 1) I am able to retrieve the records I need into dataset dsFind. Now however I want...
2
by: yxktmp | last post by:
Hi; I have a main starting query for most of my reporting. I branch out from this query to other queries. This main query contains multiple form control filters (query criterias) . I want to use...
4
by: Hapnadsmannen | last post by:
Greetings. I have a problem that I have too little experience to solve, so I hope you guys can point me in the right direction: I have 5 comboboxes with Name, Activity, Product, Project and...
25
by: Darsin | last post by:
Hi all I need to perform a summation on a column of a table based on a criteria given in another column in the same table. The catch is i need to perform different sums according to the number of...
5
by: lanman31337 | last post by:
Good afternoon everyone. I'm trying to work on an Access query so that whenever management enters certain data, it brings it up. I'm close, but no cigar. Here's the code I have in SQL: SELECT...
6
by: iheartvba | last post by:
Hi, I have a form where users have to go through a lot of data. The data is being viewed in a list box. This is because they need to be able to select one of the items in the list. The list box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.