Enter your name

mbhw99

Registered User.
Local time
Today, 15:40
Joined
Apr 3, 2012
Messages
55
On my db, I have a generic report that just prints a form for our observers to fill out. How can I make a query so they can prefill their name on the sheet?

I've thought about using a query and putting their names in it, but we have a high turn-over, the list would be loooong, and some people don't put their name as it is in our head-count list.
 
I assume you have a Form that has a print Button on it.

Create a Text Box on that form where people can enter their Name.

Then on the Report where you want the name to appear reference the Form's Text box from the Control.

Put something like this in the Text Box.

=Forms!frmFormName!txtTextBoxName
 
Rain has provided a very good option but another way to do this, especially if you do not have a form where you can get the user's input, is to create a label control in your report where you want the user's name to appear and name this control "lblUserName". Then in the On Open event of your report use the following VBA statement:

Code:
Me.lblUserName.Caption = InputBox("Enter Your Name:")

The value that the user types in the Input box will appear in the label on your report.
 
Thank you for the quick responses!

Mr. B's method was the preference. Thank you!
 
So you sorted your Runtime error.

Glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom