Question

AccessNewb

Registered User.
Local time
Today, 15:16
Joined
Oct 29, 2002
Messages
20
How do I query a table for a particular field that is specified by user input.
Ex.

I have a form that has has a text box and the user is suppose to enter the familyID that he/she wants to print. I can query for all of a certain feild but I need to have this work with a user specified FamilyID

thanks
 
Why don't you change the text box for the family ID to a combo box - the wizard will prompt you through the process to pull back the family ID and name.
 
I will give it a try.
Thanks
 
OK, combo box is in place. How do I get the information for the particular FamilyID to print?
 
Basically you want to pass the family Id across to your report as select criteria -

"WHERE FamilyID = " & Me.ComboBoxName

or a filter (without the WHERE)

How are you doing the print? Is it a report that is picking up its criteria from a query, your code, etc???
 
I have a form that has a combo box with all the FamilyID. After I chose the FamilyID I hit a command button that prints a report.
My problem is getting THE ONE FamilyID on the report. Right now it does not matter what FamilyID I chose, once I hit print all FamilyID's are printed.
I cannot figure out where to put the code you mentioned.

thanks for the help
 
OK, I can now get the Family ID on the report. BUT, I also need some other attributes and I am not sure how to get them in the report.
How would I do this?

This is what I have been trying.
I created a query by Family ID. I want to select Family ID from the drop down list and then press a button that queries for all the attributes I selected pertaining only to the Family ID I selected. I then want to format this data on a report.
Is this correct logic? If so, the problem I am running into is getting the button query for the selected Family ID. How do I do this?

Thanks for the replies
 
Does this query look right/make sense?

WHERE ((([Family Information].[Family ID])=("[Family ID] =" & [Me].[Combo6])));


What is the ME? I see it often.
 
The Me refers to the current form or report - a shortcut.

Your selection criteria should be

"WHERE [Family Information].[Family ID]= " & [Me].[Combo6]

The brackets are fine as long as they match. If this is going into the report filter, I think the WHERE word is not provided.
 

Users who are viewing this thread

Back
Top Bottom