notinlist update value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new to Access.
I have a form that has a combobox with last names. When the last name is selected the first name(text box) is auto filled
I have the notinlist event coded as follow
Private Sub Combo134_NotInList(NewData As String, Response As Integer

If MsgBox("Add New Customer?", vbYesNo, "Customer not on List") = vbYes The
DoCmd.OpenForm "QQ2", acNormal, , , acFormAdd, acDialog, NewDat
Response = acDataErrAdde
End I
End Su
This enters the correct last name into the combobox, but the text box for the first name field defaults to the first record. If I close the form and reopen the first name field is then correct
Is there some code I need to add to get the first name to update when the new last name has been added?

This code is in for after update on the combo box (This was added by wizard
Private Sub Combo134_AfterUpdate(
' Find the record that matches the control
Dim rs As Objec

Set rs = Me.Recordset.Clon
rs.FindFirst "[ID Number] = " & Str(Nz(Me![Combo134], 0)
If Not rs.EOF Then Me.Bookmark = rs.Bookmar
End Su

Thanks for any help
 
I found it.
Just needed to add Me.requery to the beginning of the after update code.
Thanks
andrea
 
Back
Top