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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a parameter with a lookup

Status
Not open for further replies.

ajmitch

Technical User
Jan 9, 2002
7
GB
Trying to pass a parameter to the query behind my report..
eg. the last line from the sql is..

WHERE[Sent To].[sentto]=[]

This displays a blank parameter box requiring the user to enter the filter parameter.
Is it possible to have the query put up a lookup option so that the user can select the required parameter from a list?

Tony
 
Tony,

Easiest way to do this would be to have a ComboBox on a separate form for the user to select their criteria. Include also a command button to execute the opening of your report and ammend your query as follows;

Code:
WHERE[Sent To].[sentto]=[Forms]![frmYourForm]![cboYourComboBox]

Thus, when the user selects a value from the cbo, the query picks up that value and usesit to poulate your report.

Hope this helps.

Leigh Moore
LJM Analysis Ltd
 
Thanks Leigh, I tried as you suggested, but it still brought up the parameter box, but this time it had 'Forms!frmSentTo!cboPickLocation' printed across the top. I think that I am getting in too deep without understanding what I am doing with Access. I have done this sort of thing in Foxpro 2.6 for Windows with no problem, been using Foxpro since 1989 (real Foxpro before MS got hold of it), but I am treading new ground attempting Access programming. I think that I need to read some good books before I go any further.
Thanks again

Tony
 
Hi again Leigh,
Sorry, ignore my last post. Your suggestion works perfectly. Having just sent that post and re-read it, I realised what I had done wrong - including the 'frm' and 'cbo' in the string. Took them out and it's fine.

Thanks again.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top