Platform = Windows
Program = Access 2003
Hi there, I am stumpped!!
I am attempting to populate a form control as follows:
I have a form that has 2 drop-down boxes. One retrieves the EMP_ID and the 2nd one retrieves the EMP_NAME and EMP_ID.
When I make a selection from the EMP_ID control, the data in the database appears accordingly. When I make a selection from the EMP_NAME control, the data in the database appears accordingly, as well.
I am attempting to have it so when I make a selection from the EMP_NAME control, the EMP_ID control becomes populated with the EMP_ID that corresponds to the selection that I make using the EMP_NAME control.
RowSource for EMP_NAME
SELECT distinct T_EMPLOYEE_2.EM P_NAME , T_EMPLOYEE_2.EM P_ID FROM T_EMPLOYEE_2 ;
[Code=VBA]
Private Sub Cmd_EmpName_Cli ck()
Dim rs As Recordset
Set rs = Me.Recordset.Cl one
rs.FindFirst "[EMP_NAME] = '" & Combo_EmpName.V alue & "' "
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
[/Code]
=============== =============== =============== ====
Rowsource for EMP_ID
SELECT DISTINCT T_EMPLOYEE_2.EM P_ID FROM T_EMPLOYEE_2;
[Code=VBA]
Private Sub Cmd_EmpID_Click ()
Dim rs As Recordset
Set rs = Me.Recordset.Cl one
rs.FindFirst "[EMP_ID] = '" & Combo_EmpID.Val ue & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
[/Code]
When I run them independently of each other, they work just fine, but I need to have the EMP_ID control be populated with the EMP_ID when a selection is made from the EMP_NAME form control and also have the EMP_NAME control populate accordingly when a selection is made from the EMP_ID form control.
I hope I have supplied enough information and have explained it clearly enough for someone to help me.
Can someone please help me with this???
Thank you VERY MUCH for your assistance.
Program = Access 2003
Hi there, I am stumpped!!
I am attempting to populate a form control as follows:
I have a form that has 2 drop-down boxes. One retrieves the EMP_ID and the 2nd one retrieves the EMP_NAME and EMP_ID.
When I make a selection from the EMP_ID control, the data in the database appears accordingly. When I make a selection from the EMP_NAME control, the data in the database appears accordingly, as well.
I am attempting to have it so when I make a selection from the EMP_NAME control, the EMP_ID control becomes populated with the EMP_ID that corresponds to the selection that I make using the EMP_NAME control.
RowSource for EMP_NAME
SELECT distinct T_EMPLOYEE_2.EM P_NAME , T_EMPLOYEE_2.EM P_ID FROM T_EMPLOYEE_2 ;
[Code=VBA]
Private Sub Cmd_EmpName_Cli ck()
Dim rs As Recordset
Set rs = Me.Recordset.Cl one
rs.FindFirst "[EMP_NAME] = '" & Combo_EmpName.V alue & "' "
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
[/Code]
=============== =============== =============== ====
Rowsource for EMP_ID
SELECT DISTINCT T_EMPLOYEE_2.EM P_ID FROM T_EMPLOYEE_2;
[Code=VBA]
Private Sub Cmd_EmpID_Click ()
Dim rs As Recordset
Set rs = Me.Recordset.Cl one
rs.FindFirst "[EMP_ID] = '" & Combo_EmpID.Val ue & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
[/Code]
When I run them independently of each other, they work just fine, but I need to have the EMP_ID control be populated with the EMP_ID when a selection is made from the EMP_NAME form control and also have the EMP_NAME control populate accordingly when a selection is made from the EMP_ID form control.
I hope I have supplied enough information and have explained it clearly enough for someone to help me.
Can someone please help me with this???
Thank you VERY MUCH for your assistance.
Comment