Captured Parameter Value

B

Bob

Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.
 
F

fredg

Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
 
G

Guest

Thanks for the reply, Fred. This works fine if the user
inputs a valid parameter value from the table. My purpose
is to display the value the user actually input so that
they could see if they made a mistake typing the input.
Example: The user wants to see all of the 'angle' iron
listed in a table but types the word 'angel' instead
in 'angle'. I want to be able to display the word 'angel'
on the report (or more likely, in a message box) so that
he can see that he typed his input incorrectly.

-----Original Message-----
Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
F

fredg

Thanks for the reply, Fred. This works fine if the user
inputs a valid parameter value from the table. My purpose
is to display the value the user actually input so that
they could see if they made a mistake typing the input.
Example: The user wants to see all of the 'angle' iron
listed in a table but types the word 'angel' instead
in 'angle'. I want to be able to display the word 'angel'
on the report (or more likely, in a message box) so that
he can see that he typed his input incorrectly.
-----Original Message-----
Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

1) If this is the case, you should be using a form to enter the
parameters, not a query parameter prompt.

Create an unbound form.
Add an unbound text control.
Add a command button.
Code the command button click event:
Me.Visible = False

In the query, as criteria on the Product column:

Like "*" & forms!FormName!ControlName & "*"

Code the Report's Open Event:
DoCmd.OpenForm "FormName", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "FormName"

Then code the Report's OnNoData event:

MsgBox "There are no " & forms!FormName!ControlName & " products."
Cancel = true

Run the report.

The form will open.
The user types all or part of the product name (i.e. angle).
Click the Form's command button.

If there are matching records all products that contain "Angle" in the
name will be shown.

If there are no matching records, you will get a message box with the
the incorrectly entered text, and the report will be canceled.

When the report closes, it also closes the form.
 
W

wuyouren

??????:
Thanks for the reply, Fred. This works fine if the user
inputs a valid parameter value from the table. My purpose
is to display the value the user actually input so that
they could see if they made a mistake typing the input.
Example: The user wants to see all of the 'angle' iron
listed in a table but types the word 'angel' instead
in 'angle'. I want to be able to display the word 'angel'
on the report (or more likely, in a message box) so that
he can see that he typed his input incorrectly.

-----Original Message-----
Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
W

wuyouren

Thanks for the reply, Fred. This works fine if the user
inputs a valid parameter value from the table. My purpose
is to display the value the user actually input so that
they could see if they made a mistake typing the input.
Example: The user wants to see all of the 'angle' iron
listed in a table but types the word 'angel' instead
in 'angle'. I want to be able to display the word 'angel'
on the report (or more likely, in a message box) so that
he can see that he typed his input incorrectly.

-----Original Message-----
Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
F

fredg

Thanks for the reply, Fred. This works fine if the user
inputs a valid parameter value from the table. My purpose
is to display the value the user actually input so that
they could see if they made a mistake typing the input.
Example: The user wants to see all of the 'angle' iron
listed in a table but types the word 'angel' instead
in 'angle'. I want to be able to display the word 'angel'
on the report (or more likely, in a message box) so that
he can see that he typed his input incorrectly.

-----Original Message-----
On Thu, 9 Sep 2004 11:58:26 -0700, Bob wrote:

Anybody have a brilliant idea for this? I need to capture
the user input parameter value in a query and display it
in a report.

Add an unbound text control to the report header.
Set it's control source to something like:
="For sales between " & [Enter Start Date] & ' and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed query
prompts.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

One of these last 3 messages you sent has an attachment.
Please don't post messages with attachments.
I, and most other readers, won't open it.
If you have a follow-up question, please write it out in the message
body.
 
Top