Display parameter used for query

P

Pyrite

I have a query set up to search for people eligible to access a specified
site. An unbound combo box on a form allows the user to select from a
predefined list of sites, a button then opens another form which displays the
results from the query. In the query the criteria is as follows:

[Forms]![frmQryParam]![cboSiteName]

This is done on an 'or' basis for five site fields as any one person can
have access to up to five sites. For this reason I dont display the site
names on the form displaying the queires results as the user will only be
interested in one site. So basically, the user selects a site name and the
query returns the details (ID No, Forename, Surname) of any one with access
to that site in a form. I would also like to display the site name that the
user has searched for in that form so they can confirm it and also hopefully
realise if they have selected the wrong site by mistake. It is not displaying
a result that I want but the actual parameter used in the search.

Is this possible?
 
L

louisjohnphillips

I have a query set up to search for people eligible to access a specified
site. An unbound combo box on a form allows the user to select from a
predefined list of sites, a button then opens another form which displaysthe
results from the query. In the query the criteria is as follows:

[Forms]![frmQryParam]![cboSiteName]

This is done on an 'or' basis for five site fields as any one person can
have access to up to five sites. For this reason I dont display the site
names on the form displaying the queires results as the user will only be
interested in one site. So basically, the user selects a site name and the
query returns the details (ID No, Forename, Surname) of any one with access
to that site in a form. I would also like to display the site name that the
user has searched for in that form so they can confirm it and also hopefully
realise if they have selected the wrong site by mistake. It is not displaying
a result that I want but the actual parameter used in the search.

Is this possible?

This may be a trick. However, I have created a text edit on the
screen or on the report. I set the control source property to
=[Forms]![frmQryParam]![cboSiteName]. Note it is the "equals" sign
before the name of the control that holds the parameter.
 
P

Pyrite

Thanks for that, it doesn't seem to work thoough. I created a text box on the
form which displays the query results and put the string in there. All I got
was #Name. My original form closes after the name is selected from the drop
down box.

Basically, frmQryParam opens and has a drop down of all site names. The user
selects the site and presses a control button with code :

Private Sub btnSearchfrmQryParam_Click()
DoCmd.OpenForm "frmEngineersClearedForSite"
DoCmd.Close acForm, Me.Name
End Sub

So it opens the form which runs the query and then closes itself. The form
frmEngineersClearedForSite then displays the reults of the query, thats where
I want the site name to appear based on what the user selected originally.

I have a query set up to search for people eligible to access a specified
site. An unbound combo box on a form allows the user to select from a
predefined list of sites, a button then opens another form which displays the
results from the query. In the query the criteria is as follows:

[Forms]![frmQryParam]![cboSiteName]

This is done on an 'or' basis for five site fields as any one person can
have access to up to five sites. For this reason I dont display the site
names on the form displaying the queires results as the user will only be
interested in one site. So basically, the user selects a site name and the
query returns the details (ID No, Forename, Surname) of any one with access
to that site in a form. I would also like to display the site name that the
user has searched for in that form so they can confirm it and also hopefully
realise if they have selected the wrong site by mistake. It is not displaying
a result that I want but the actual parameter used in the search.

Is this possible?

This may be a trick. However, I have created a text edit on the
screen or on the report. I set the control source property to
=[Forms]![frmQryParam]![cboSiteName]. Note it is the "equals" sign
before the name of the control that holds the parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top