Form as Query Parameter

tMitch

Registered User.
Local time
Today, 12:00
Joined
Sep 24, 2002
Messages
43
I would like to use a form as a parameter for my query, but don't know how to do it. Right now my parameter is: Like ([CNTRT ID#: 1=Contract1, 2=Contract2, 3=Contract3]) and the user types in 1,2 or 3 when the Enter Parameter Value box appears.

Instead of having that Enter Parameter box, I want a form to pop up where the user selects the Contract Name which then sets the Contract ID# parameter. I have created a form where the Contract Names are option buttons and the option value equals the Contract ID#......?

Should I be using something else on my form to give the Contract ID# (combo box)? How do I write the query criteria so that it opens the form and then runs based on the input on the form?


Thanks in advance.
:confused:
 
With your cursor in the criteria row for the field, select the Build ... button from the Toolbar. (It looks like a wand with pixie dust, next to the Properties toolbar button) This will bring up a dialog box that will have all of the objects in your database. Double-Click on Forms and then select All Forms. Single-Click on the form that has the control that you would like to reference. In the middle selection area, all of the controls on that form will appear. Double-Click the control name that you would like to reference. The full qualified name of the reference will now show up in the Expression Builder area. Click on OK and that's it!
 
Thanks for your reply. I did as you suggested and it did refer me to the control on the form, but I was hoping to actually bring up the whole form and then click the parameter criteria from there (rather than using the Enter Paramenter Value dialog box).

I guess what I am really trying to do is create my own Enter Parameter Value box so that I can fit more info on it. Is this possible? Should I be approaching this problem in some other way?

Thanks for any suggestions.
 
The query is for a report. I have a form with a button to run the query, but I still have to use the paramters to put in the Contract id number in order to get a report for a specific contract. That may be because I haven't figured out how to get the button to do the query only for the specific contract I'm inputting data on at the time. The parameter criteria as is works okay for me, but is not convenient for other users.

I'll keep working on it. Thanks for your help.
 
Read the thread that I posted earlier. Basically, you have your report based on your query. Remove the parameter and have it point to the form. Run the report from a button on the form after the user has entered a value in the text box that the query points to.
 
Thank you pdx-man! That worked - exactly what I was looking for!:)
 

Users who are viewing this thread

Back
Top Bottom