Show user input in message box

  • Thread starter Thread starter ironwood9 via AccessMonster.com
  • Start date Start date
I

ironwood9 via AccessMonster.com

I have a report whose source is a query with criteria that is based on user
input - when the query is run ( or the report ), a message box pops up and
says "Enter partial description" - if a match is found in the specified field,
then the records are displayed - there is error handling if no records are
found, with a canned message hard-coded stating "NO RECORDS FOUND"

Is there a way to have whatever string the user entered as criteria pop up ?


For example, if the user typed "March," and there were no matches, then the
message would say:

No records found with "March" in the description, and so on.
 
ironwood9 via AccessMonster.com said:
I have a report whose source is a query with criteria that is based on user
input - when the query is run ( or the report ), a message box pops up and
says "Enter partial description" - if a match is found in the specified field,
then the records are displayed - there is error handling if no records are
found, with a canned message hard-coded stating "NO RECORDS FOUND"

Is there a way to have whatever string the user entered as criteria pop up ?


For example, if the user typed "March," and there were no matches, then the
message would say:

No records found with "March" in the description, and so on.
 
Hmmm...

That may not be so easy.
If what you are doing is to build a query similar to this:
SELECT * FROM MyTable WHERE myDescField Like "*" & [Enter text Here] & "*";
and trapping the NO DATA Event in the report, that may not be so easy to do.
I don't know if you can use the report's object model to retrieve that
dynamically generated Query Parameter value.

If that is the functionality you require, then you may have to change how
you do things entirely.

You may need to open a form or run some code to feed the reprt its query and
its prompt text via the docmd.openreport method call (you can supply the
parameter as the OpenArgs parameter value (or as part of it) and you can the
add some code to your NODATA event to retrieve and use the me.openargs value
(if present).
 
Mark,
Thanks so much !
Steve

Mark said:
Hmmm...

That may not be so easy.
If what you are doing is to build a query similar to this:
SELECT * FROM MyTable WHERE myDescField Like "*" & [Enter text Here] & "*";
and trapping the NO DATA Event in the report, that may not be so easy to do.
I don't know if you can use the report's object model to retrieve that
dynamically generated Query Parameter value.

If that is the functionality you require, then you may have to change how
you do things entirely.

You may need to open a form or run some code to feed the reprt its query and
its prompt text via the docmd.openreport method call (you can supply the
parameter as the OpenArgs parameter value (or as part of it) and you can the
add some code to your NODATA event to retrieve and use the me.openargs value
(if present).
I have a report whose source is a query with criteria that is based on user
input - when the query is run ( or the report ), a message box pops up and
[quoted text clipped - 8 lines]
No records found with "March" in the description, and so on.
 

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

Back
Top