0
votes

I'm working on a little project in Access using VBA. I created a report with some data from three different tables. In the Report_Open method I want to assign a query to the ControlSource of a TextBox.

Here is my code

Me.textImpactP.ControlSource = DLookup("[ImpactText]", "Root_cause_basic_reports", "[Report_id] =" & rid & " And [Root_cause_basic_id] =" & rootCauseId)

When I run this I keep getting the dialog "Enter Parameter Value".

dialog

The parameter "people" is the result of my DLookup and is supposed to be the value of my TextBox on my report.

Does anyone have an idea how to get the parameter "people" as a value in my TextBox?

1
Got it, i had to set the value of the textboxes like this: Me.textImpactP = Nz(DLookup("[ImpactText]", "Root_cause_basic_reports", "[Report_id] =" & rid & " And [Root_cause_basic_id] =" & rootCauseId)) and put it in the load event and not in the open event. - Vinny

1 Answers

0
votes

Enter Parameter value does not represent, what you think it does. It normally pops up when you try to open a Report whose record Source is based on a Query which requests a parameter. Check the Query again.