expublish
Registered User.
- Local time
- Today, 00:09
- Joined
- Feb 22, 2002
- Messages
- 121
I have a combo box (called Combo14) on a form. It is looking up a field (employee name - employee id is the p/k but i don't want that listed - just employee name) in a table (employee) and when the user selects a name it takes them to the relevant record. Now, the values are listed OK, but whatever name I click that is listed it always takes me to the first record, not the relevant record that was selected.
Anyone got any ideas? The code looks like this:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
DoCmd.Close
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Private Sub Combo14_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Employee ID] = " & Str(Me![Combo14])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub searchemp_BeforeUpdate(Cancel As Integer)
End Sub
Can anyone shed some light and ammend the above code to get me out of this very deep hole that seems to be getting deeper and deeper ... hello? heeeeeellooooooooo?
Ta. Scott.
[This message has been edited by expublish (edited 03-06-2002).]
Anyone got any ideas? The code looks like this:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
DoCmd.Close
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Private Sub Combo14_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Employee ID] = " & Str(Me![Combo14])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub searchemp_BeforeUpdate(Cancel As Integer)
End Sub
Can anyone shed some light and ammend the above code to get me out of this very deep hole that seems to be getting deeper and deeper ... hello? heeeeeellooooooooo?
Ta. Scott.
[This message has been edited by expublish (edited 03-06-2002).]