C
Craig
I have a form, frmAssociates, that displays employee information (name,
address, shift, employee no., etc.) for one employee at a time.
A drop-down box, cmbAssocPicker (in the form header), contains all employees
in the database. Using the drop-down box, the user can select an employee
and the form will display that employee's information.
There is also a button on the form, btnNewAssoc, which opens a new form,
frmAssocEntry, for adding a new employee.
The problem is that after adding a new employee, the new employee's name is
not in the drop-down box. I have to close and re-open the form for the
employee's name to appear.
I would like to be able to instantly see the new employee's name in the
drop-down box, and to potentially be able to select that new employee, to
view his/her information like any other employee already in the list.
I am using Access 2003. Here is the Visual Basic code behind the drop-down
box:
Private Sub cmbAssocPicker_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[AssocNo] = " & Str(Nz(Me![cmbAssocPicker], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Any help is greatly appreciated!
Thanks,
Craig
address, shift, employee no., etc.) for one employee at a time.
A drop-down box, cmbAssocPicker (in the form header), contains all employees
in the database. Using the drop-down box, the user can select an employee
and the form will display that employee's information.
There is also a button on the form, btnNewAssoc, which opens a new form,
frmAssocEntry, for adding a new employee.
The problem is that after adding a new employee, the new employee's name is
not in the drop-down box. I have to close and re-open the form for the
employee's name to appear.
I would like to be able to instantly see the new employee's name in the
drop-down box, and to potentially be able to select that new employee, to
view his/her information like any other employee already in the list.
I am using Access 2003. Here is the Visual Basic code behind the drop-down
box:
Private Sub cmbAssocPicker_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[AssocNo] = " & Str(Nz(Me![cmbAssocPicker], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Any help is greatly appreciated!
Thanks,
Craig