Capture Query Parameter?

  • Thread starter Thread starter G
  • Start date Start date
G

G

I have a select query with a parameter that I'm using as my data source for a
form. The function of the form is to search a data source. As expected,
when I open the form, I get a message box with a parameter request. I would
like to do two things:

1) Capture' the information that is entered in this parameter request for
future reference.

2) Change the messagebox title

Is this possible?

Thanks, in advance, for your help.

G
 
Hi, G.

I would suggest that instead of using a parameter in your query that you
create a small form with a text box or some other control where users can
provide the criteria (parameter) for the query. After they have entered the
info in the form you can capture that value. To use the value in you query,
just replace your parameter statement with a reference to the control on your
new form. You can then use an button on the new form that will open the form
that uses the query as its recordsource.
 
Thanks for the response, Mr. B. However, I thought of that and was hoping
(beyond hope) that there was a more efficient way of doing this (VB?).

Any other ideas?

G
 
I may be missing something, but there is nothing less efficient about using a
form to get the parameters for queries.

If there is more to this, then please explain and I will try to assist.

This could actually be done in the OnOpen event of your form by adding VBA
code to prompt for the parameter value instead of having the parameter as
part of the query, but then you would have to update your query to know the
parameter value or create the sql statement in VBA and assign that sql
statement to be the row source for your form.

As with most situations in Access, there are multiple ways to get from point
A to point B.
 
Back
Top