Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

showing user input on report

Status
Not open for further replies.

mwhalen

Programmer
Oct 31, 2000
217
CA
I'm rusty on my Access. Here's how I set up the parameter on my Admin code field in my table:

Like Nz([Please enter exact name of Admin Code ex LMH],'*')

I didn't create a separate parameter, I create the parameter dynamically as part of the criteria.

So now my question is - how do I pass the user inputed criteria on the report? I can't just pass the field because what if the user doesn't put in a value, i.e. *

thanks.
 
Can anyone please help me with this?
 
where is this parameter used? is it in a query? is the query the recordsource for the report?
 
How are ya mwhalen . . .

Get the input from a user defined function instead. Within the function, assign the input to a public variable.

Calvin.gif
See Ya! . . . . . .
 
mwhalen . . .

In the declaration section of a module in the modules window, copy/paste the following:
Code:
[blue]Public cdeAdmin[/blue]
In the same module, copy/paste:
Code:
[blue]Public Function AdminCode()
   Dim Prmpt As String, Title As String, Rtn As String
   
   Prmpt = "Please enter exact name of Admin Code ex LMH"
   Title = "Admin Code?"
   
   Rtn = InputBox(Prmpt, Title)
   
   If Rtn = "" Then
      cdeAdmin = "*"
   Else
      cdeAdmin = Rtn
   End If
   
End Function
[/blue]
In the criteria of your query, instead of:
Code:
[blue]Like Nz([Please enter exact name of Admin Code ex LMH],'*')[/blue]
use:
Code:
[blue]Like AdminCode()[/blue]
In the report you get the entered data from [blue]cdeAdmin[/blue]!

Calvin.gif
See Ya! . . . . . .
 
thanks for the ideas. The parameter is used in the query and the query is the recordsource for the report. I'm more or less writing the report for someone else's application. Is there not an easier way to just reference the user input in the report?
 
[/blue mwhalen][/quote]Is there not an easier way to just reference the user input in the report?[/blue][/quote]
Not when its input as a parameter in a query!

I agree . . . it would be nice! . . .

Calvin.gif
See Ya! . . . . . .
 
In the query sql view pane:
SELECT ....
, [Please enter exact name of Admin Code ex LMH] AS UserInput
FROM ...
WHERE ... Like Nz([Please enter exact name of Admin Code ex LMH],'*')


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top