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!

query that prompts user for data & returns matching records in table

Status
Not open for further replies.

rta

MIS
May 1, 2001
13
0
0
US
Hello.

I am a novice at VB and actually at SQL, although I have been working more with SQL, so please bare with me.

Here's my dilemma...

I have a database and one of the fields is called SI_Name (a text field), which is the name of a person that inputs their own records via a form. One SI_Name can have many records. I also have a field called collection period (a Date/Time field with format mmm yy example Apr 01). I queried the database to lists all the distinct collection periods (which is only one, for now) and SI_Names in the 'all fields' table which is linked to the input form used by the users.

Now, I want to prompt the user for an SI_Name and collection period they want to search for and return all of the matching records. For instance, SI_Name EE has 5 records that were entered for collection period Apr 01.

I think that I have many leads and thoughts on this, but I just don't know where to begin and incorporate all of this in VB or do I even have to use VB for this type of thing at all. Hopefully I can get some pointers from you. Any help would greatly be appreciated. Thank you much.

Sincerely,
RTA
 
You don't HAVE to use vb, you can enter the criteria in the query and have access prompt for the data when it is run.

In the criteria for SI_Name put this:

[Enter SI Name:]

In the criteria for CollectionPeriod put this:

[Enter Collection Period (MMM YY):]

If the user enters the data correctly, the data will be returned. This is called a Parameter query and are used frequently in Access.

HTH Joe Miller
joe.miller@flotech.net
 
Thanks for your help, Joe! It works. I had no idea it was that simple. I thought I'd be slinging VB code for days. :)

RTA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top