By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

Using a query to control a report

P: 12
Once again I must apologise for my lack of knowledge with access, although I am learning quickly!

I have a report which I want a query to control. The query will ask for someone’s name and then date of birth to pick out a particular person in the database.

I can do this fine.

However i want to be able to use drop down boxes to control the data input of both the name and DOB. What I have tried so far is to use a form for each, and have the data submitted to the query.. It of course didn't work.

Any help would be gratefully received!

Many thanks, Andy
Mar 12 '07 #1
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Andy you just need one form for both combo boxes as they forms have to be open for the query to work.

Mary
Mar 12 '07 #2

P: 12
Andy you just need one form for both combo boxes as they forms have to be open for the query to work.

Mary

thanks for that, the query works now, however i have come across another problem.

i dont know how to feed the information i have got in the query into my report.

Using the control box in the report i have set the query as the control source.. however when i open the report i get a parameter box with the criteria i have set in the query.. (forms!frmformname!etc.....)

any help would be great!
many thanks

andy
Mar 12 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Andy,

Assuming your query is set up like ...
Expand|Select|Wrap|Line Numbers
  1. SELECT empID, empName
  2. FROM Employees
  3. WHERE empID=[Forms]![FormName]![ControlName]
  4.  
Then just set this as the Record Source of the report. You don't need to change the control source of any of the textboxes.

Mary
Mar 12 '07 #4

P: 12
Andy,

Assuming your query is set up like ...
Expand|Select|Wrap|Line Numbers
  1. SELECT empID, empName
  2. FROM Employees
  3. WHERE empID=[Forms]![FormName]![ControlName]
  4.  
Then just set this as the Record Source of the report. You don't need to change the control source of any of the textboxes.

Mary
Thanks very much for that Mary,

Using your guidance I altered my code a little and used a macro to open the report once the query had ran. I'm not sure if it was the right way to do it but it seems to be working well!!

many thanks

andy
Mar 12 '07 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
You're welcome.
Mar 12 '07 #6

Post your reply

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