Parameter question

  • Thread starter Thread starter Themba
  • Start date Start date
T

Themba

I have form based on a query that has a paramenter. Somewhere in the code I
would also like to use data that was entered in that parameter.

My question is how do I retrive or address the value in this paramemeter?

Thanking U guys in advance

Regards
T
 
The easiest way that I know of is to control the parameter entry yourself. Either

1. use VB and get the parameter value from a inputbox, then open the results form by either constructing the SQL string with the parameter value, OR passing the parameter as a where clause on a docmd.openform. (To do this, modify the query to remove the parameter and let it return all records.

2. Open an input form in dialog mode with a textbox, an OK button and a cancel button. Change your query parameter to refer to the textbox, like forms!inputform!entrytextbox. When the user presses ok on the form, set the input form's visible property to no. This will return code execution to the calling form. Then, open the "results" form, which can grab the value from the input form or have it passed to it as an openarg. Finally, close the input form. This sequence is far simpler than it sounds

Hope this helps

- Scot

----- Themba wrote: ----

I have form based on a query that has a paramenter. Somewhere in the code
would also like to use data that was entered in that parameter

My question is how do I retrive or address the value in this paramemeter

Thanking U guys in advanc

Regard
 
Thanks, I actually know how to do that, I just thought maybe the is another
way of referring to that parameter without opening forms and so on, anyway
thatnks again

ScottE said:
The easiest way that I know of is to control the parameter entry yourself. Either:

1. use VB and get the parameter value from a inputbox, then open the
results form by either constructing the SQL string with the parameter value,
OR passing the parameter as a where clause on a docmd.openform. (To do
this, modify the query to remove the parameter and let it return all
records.)
2. Open an input form in dialog mode with a textbox, an OK button and a
cancel button. Change your query parameter to refer to the textbox, like
forms!inputform!entrytextbox. When the user presses ok on the form, set the
input form's visible property to no. This will return code execution to the
calling form. Then, open the "results" form, which can grab the value from
the input form or have it passed to it as an openarg. Finally, close the
input form. This sequence is far simpler than it sounds.
 
Back
Top