Open specific record on a form from another form

trackmedic

Registered User.
Local time
Today, 07:29
Joined
Aug 20, 2001
Messages
115
Hi,

I have a form that I put records of employees that have certian training. I also have a startup form on my data base. I would like to place a combbox on the startup form that list the employees names. When a person chooses an employees name from the combo box, I would like the other form to open up and go to the record of the employee that was chosen. How do I do that !!!!!????????

Thanks in advance
Andre'
 
I would like to do this....

Using a macro. I have made a macro using the macro wizard to open form#1. and sort off of the field name employee#1. I have put the following syntax in the where box of the open form command [employee#1]=[Forms]![form#2]![employee#2]

all it brings up is form #1 with 1 record that is blank......:-(
 
On the Click event of your button:

docmd.openform "YourForm"

Forms![YourForm]![ID].SetFocus
DoCmd.FindRecord Me![ID]

This code uses the ID field on each form to find the record. You may have to play with it a bit to get the correct field.
HTH
Dave
 
Given that you are using a combo box to look up the employee, you can use the afterupdate event of the combo box as follows:

DoCmd.OpenForm "2ndForm", , , "EmployeeID =" & Me.CboEmployee

Note: 2ndForm = The name of the second form you want to open with the employee information
EmployeeID = The name of the Employee ID in the Employee table etc
CboEmployee = the name of the combo box on the first form (I imagine it is unbound)

Note: The bound column of the combo box must be capturing the ID of the employee, and not the Employee name etc. It can display the name, but will need to capture the ID number.

Brad.
 
Brad

Does your code display all the records and go to a specific record or apply a filter and only show 1 record ?
Dave
 
Howdy Dave,

You are right, the method I described will result in a recordset of only one (1). (Given that only 1 employee ID exists - PK etc)

I gathered that as Andre seems to want to select the employee rather than navigate, it would not matter filtering down to specific records. On closing the form, Andre could then reselect anther employee etc.



Hey, what happened to the burning fridge?

Brad.
 
Just trying to get into the Christmas spirit... or is that Christmas Spirits :D

Hope you didn't get flooded out the other night. It p..ssed down here ! Need it but
Dave
 
Hey you all THANKS !

Just wanted to drop all of you guys a big thank you for the help. Once I realized that I needed to use the record ID instead of the employees name it worked like a charm. to all of you have a happy and safe holiday season.



Thanks

Andre':)
 

Users who are viewing this thread

Back
Top Bottom