Pass variables to reports (1 Viewer)

KevGooss

New member
Local time
Today, 04:33
Joined
Dec 27, 2000
Messages
5
I have a report that is based on a query that is based on an SQL statement that is generated by a QBE form. The QBE form allows multiple selections and the selections are stored in a string variable. How can I pass this string variable to the report so the user can see these selection criteria in the report header? I tried to create a text box on the report and use it's SET property on the OnOpen event in the report, but no luck.
 

Abby N

Registered User.
Local time
Today, 04:33
Joined
Aug 22, 2000
Messages
123
Perhaps you could modify your SQL statement to include the string variable as one if it's fields. For example:

"SELECT Table.Field1, Table.Field2, '" & strYourVariable & "' AS fldCriteria FROM Table WHERE Field1 = Something"

You can then create a control on the report to show that field. In this case a field named fldCriteria. Good luck.

~Abby

[This message has been edited by Abby N (edited 12-28-2000).]
 

Charlie

Registered User.
Local time
Today, 04:33
Joined
Jan 7, 2000
Messages
16
I think that I'd use a hidden text box on the form that always calls the report. Fill that text box with your string and then create a new box on your report and set the control source to something like:-

[Forms]![MyForm]![MyHiddenTextBox]

Hope this helps,

C
 

Users who are viewing this thread

Top Bottom