| re: Use result from Inputbox in query
"Roberta" <rhastin@dhs.state.ia.us> wrote in message
news:cc6b0d09.0406180530.1b52233f@posting.google.c om...[color=blue]
> Hello,
>
> When I use the following code to print a report for a certain client,
> it works fine:
> DoCmd.OpenReport "rpt_MNMTSingleCover_Summary_Recommendations",
> acPreview, "",[/color]
"[qry_MNMTSingleCover_Summary_Recommendations]![strClientID]=[Enter[color=blue]
> Client ID]"
>
>
> But I want to run multiple reports for the same client without asking
> for the client ID more than once so I tried the following code:
> Dim clientid As String
> clientid = InputBox("Enter Client ID")
>
> DoCmd.OpenReport "rpt_MNMTSingleCover_Summary_Recommendations",
> acPreview, "",[/color]
"[qry_MNMTSingleCover_Summary_Recommendations]![strClientID]=clientid"[color=blue]
>
> When I run this code it asks for the client ID OK but after I enter
> the ID, I get another window that wants me to enter the parameter
> value for clientid.[/color]
Save the result of the inputbox to a textbox control on the form and then
reference the textbox control in your Where Condition. An example of
the syntax can be found in help under 'OpenReport Action'. |