Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2k query problems.....

Status
Not open for further replies.

bapprill

Technical User
Oct 14, 2002
37
0
0
US
Im fairly new to Access as well as visual basic, but not programming or computers in general. I am trying to add some fields in a search function on our access menu. I would like to know how to add the ability to search by date. I need to be able to search two tables, using one field. Any help would be GREATLY appreciated.
 
There are several ways to approach this depending on what you want in the end result. I'll give you a Non-Visual basic approach.

Create a Text Box on your form for the user to put the date in. Create a query for the table(s) that you want to look up. Within that query, set the Criteria for the date field you are searching to be equal to the Text Box on your form. The easiest way to do this is to right click in Criteria and use the Builder. You can put a button back on your main form that calls the queries to run. Depending on how you want the format of your main form, you could even embed the queries as subforms into your main form

You can essentially do the same thing with Visual Basic by storing SQL statements in strings variables. You could then build an array or populate a form with the SQL statement. All of these methods, including the one above, are doing the same thing. The coding methods are a cleaner approach in the end, but a bit more frustrating to figure out if you are not familiar with VB.

I hope this helps.
 
Thank you. I would like to use VBA, but know the program/syntax well enough. gggrr....
I'll give the other method a try though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top