Drop Down Won't Requery

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

The following code allows a user to type in a record in
the dropdown box and if the record does not exists it
prompts the user to add the record via another form. The
problem is the drop down will not requery. It works in
DAO but not ADO.

The record does get added to the table but the user has to
close the form and then reopen it to see the new record in
the drop down box.

Any suggestions?

Private Sub cboVendor_NotInList(NewData As String,
Response As Integer)

Dim strMsg As String


strMsg = "Vendor not on list. Would you like to add
it?"

If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "New
Vendor") Then
pintResponse = acDataErrContinue
MsgBox "You must select from the dropdown list or
add the Vendor.", vbOKCancel
Else
DoCmd.OpenForm "frmAddEditVendor", , , , , acDialog
pintResponse = acDataErrAdded

End If

End Sub
 
Back
Top