Displaying Query parameters on a form

W

WebDude

Hello.

Ive displayed the parameters of a query on a report before, simply by
entering the name of the parameter in the control source of a textbox.
However, that approach does not seem to work if i want to display the query
parameters on a form.

cheers,
WebDude!
 
6

'69 Camaro

Hi.
However, that approach does not seem to work if i want to display the query
parameters on a form.

This isn't the answer you want to hear, but there's no way to retrieve the
parameters that were used to create the record source for the form, because
the query "has already run." The workaround is to add these parameters as
field names in the query so that text boxes can be bound to these fields on
the form. For example:

PARAMETERS [PopState] Text ( 10 );
SELECT Population, [Enter City:], PopState
FROM tblPopulations
WHERE ((City Like "*" & [Enter City:] & "*") AND (State LIKE "*" & PopState
& "*"));

As you can see, it will work with both formal parameters and input parameters.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
W

WebDude

That does seem like a round-a'bout way,
but im a desperate man in desperate times.
And desperate times call for desperate measures..
and your idea sounds crazy enough
it
just
might
work.


So, if you dont hear back from me within 36hours,
dont panic!!

WebDude.



'69 Camaro said:
Hi.
However, that approach does not seem to work if i want to display the query
parameters on a form.

This isn't the answer you want to hear, but there's no way to retrieve the
parameters that were used to create the record source for the form, because
the query "has already run." The workaround is to add these parameters as
field names in the query so that text boxes can be bound to these fields on
the form. For example:

PARAMETERS [PopState] Text ( 10 );
SELECT Population, [Enter City:], PopState
FROM tblPopulations
WHERE ((City Like "*" & [Enter City:] & "*") AND (State LIKE "*" & PopState
& "*"));

As you can see, it will work with both formal parameters and input parameters.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


WebDude said:
Hello.

Ive displayed the parameters of a query on a report before, simply by
entering the name of the parameter in the control source of a textbox.
However, that approach does not seem to work if i want to display the query
parameters on a form.

cheers,
WebDude!
 
W

WebDude

hehe i posted that 4 years ago :-D
but any replies are apperciated :)
and nice link btw :)

Cheers,
WeeeeeeeeeebDude away!
 
Top