473,396 Members | 1,861 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,396 software developers and data experts.

Filter a datasheet using a form

hi there,

i need your help for a solution and code (if neccessary), to help me to filter a datasheet using a COMBO BOX.

i have a query, which contain the following example:

NAME | AGE | COURSE ATTENDING
John | 29 | DOSH
Erix | 20 | DOSH
Alex | 20 | CAT
Brat | 21 | CAT
June | 22 | CAT

i need to find out who are the ones attending DOSH or CAT. i have a large database of names and i need a filter (using combo box) to list out the names that are attending these course using access form. is it possible?

can you help? much appreciated.
Feb 23 '10 #1
4 6125
hedges98
109 100+
Do you want the results to display on the form? Or via a report?
Feb 23 '10 #2
hi there,

would like it to be displayed on the form. :)

thanks
Feb 23 '10 #3
hedges98
109 100+
Well, this is what I do when I need the same. Create a textbox on your form and set it's Control Source to be the combobox you are using for filtering. Set it's Visible property to No so it is hidden on the form.

Then, on your query, in the Course Attending field, in the Criteria section set it to be the textbox on that form - it'll be something like
Expand|Select|Wrap|Line Numbers
  1. [Form]![YourFormName]![YourTextbox]
Create a subform on your existing form based on this query. Then, in the After Update event of the combo box you're using, put
Expand|Select|Wrap|Line Numbers
  1. Me.YourSubformName.Requery
and every time you change selection from the combobox, it should update with your filter.

There is probably a more efficient way to do it but that's what I do!
Feb 23 '10 #4
thank you hedges98. and sorry for the late reply. :)
Mar 16 '10 #5

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

Similar topics

2
by: Sanders | last post by:
I inherited an Access database and I have not worked with Access for very long. I have a Form that goes through a bunch of different queries until it spits out a datasheet with all kinds of...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
2
by: Terry | last post by:
I have cerated a Form, ExamsFrm, which is used to input details of exams taken at several Centres. It dosplays details from StudentTbl and has a SubForm which displays details from ExamsTble. I...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
3
by: Tony Williams | last post by:
Sorry to repost but I cannot work this out. Can anyone come up with a suggestion? I have a main form based on Table1. The form has a tab control of three pages. Each page has a subform based on a...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
2
by: SirPoonga | last post by:
Is it possible that when having a user using Filter By Form in a form that no matter what the user enters in for a value that "LIKE *Value*" gets automatically replaced? Would I have to do...
2
by: Tim Marshall | last post by:
The following is happening in two instances in A2003. The one I s\describe is the easiest one. Theme controls and autocorrupt have been turned off long ago. An unbound main form with a list...
5
by: NTE | last post by:
Access 2000, My application has a main form that the users interact with. There are 2 hidden fields. When they select "filter by form" from the menu, the hidden fields become visble. Is...
11
by: darnnnel | last post by:
Hi, I have a form which has a subform in datasheet view. In access 2007, there is an arrow by each column which allows me to set a filter. Ussually when i click the arrow, i get a choice of records...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.