Include Variable Data from Input Box to Report Header

Graham T

Registered User.
Local time
Today, 07:27
Joined
Mar 14, 2001
Messages
300
I have created a report that is based on a questionaire filled in on a form.

The results of the form can then be printed out and I would like to include an input box to ask for the users name to be included in an unbound text box, based in the report header.

Can anyone please help with the code that is required to perform this and place the variable data into the report.

I would imagine that this would be added to the On Open event of the report.

TIA

Graham
 
Graham,

In an unbound textbox in the report header in design veiw try:

=Forms!FormName!UserNameControl

Catch:

The form must be open for the report to get the UserName.

HTH,

Lyn
 
Thanks Lyn

I figured this out by using the following attached to the On Open event of the report:

Code:
Private Sub Report_Open(Cancel As Integer)

'Creates an input box asking for the user's name and maximises report
    Me.Label35.Properties("Caption") = InputBox("Please type your name", "Name")
        
End Sub
 

Users who are viewing this thread

Back
Top Bottom