View Full Version : textbox in form to open another form


alguzman
09-08-2001, 05:14 AM
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

jwindon
09-08-2001, 06:48 AM
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.

Jack Cowley
09-08-2001, 09:34 AM
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.