textbox in form to open another form

alguzman

Registered User.
Local time
Today, 16:13
Joined
Aug 2, 2001
Messages
63
Hi, I have a form with Comapny name,Company Id number as key field and a unbound text box. Within the form is a subform with all employee names and their individule ids.

What I want to do is enter the individual id in the main forms text box hit enter and that persons individule form opens showing their activity.

Any help
 
Ok. My coding experience is still very limited so hopefully those guys will come to the rescue here. But I CAN show you the macro to do this.

I won't make attempts to ask why you are doing it the way you are, but only answer based on what you have now. There are better ways, I'm sure.

Anyway, on the AfterUpdate event of your unbound text box you will need to run a macro that does this:

Activity: OpenForm
Arguments: Form
ActivityForm
Where: [EmployeeID]=[Forms]![FormYouWereOnName]![UnboundTextControlName]

Hope that helps. Sorry, I haven't messed with that code yet.
 
I would suggest a combo box that shows employee name with the bound column their ID as the source of the employeeID rather than a text box, but either will work. The combo box will allow you to select only current employees and there won't be any errors. Anyway, the subforms Master Link should be either your text box or the combo box and the Child Link will be the EmployeeID from the form that is your subform.
 

Users who are viewing this thread

Back
Top Bottom