I am in a combobox (Combo242, which is a ContactID#) and I enter a new full name which is not on the list. My notinlist event runs and if I answer yes a pop-up form allows me to add the new contact. After the contact is saved, I am automatically returned to the control and want to fill it with the new value. I set the new value to TempVars!contactID and then try to requery, I get the error message "You cannot requery as the control has not been saved.
I can't figure out how to show the new Contact.
Code:Private Sub Combo242_NotInList(NewData As String, Response As Integer) NewContact = StrConv(NewData, vbProperCase) If MsgBox(NewContact & " Is not in the Contact list." & Chr(10) & _ "Do you want to add it to the Contacts?", _ vbYesNo + vbQuestion) = vbYes Then DoCmd.OpenForm "frmContactsLight", acNormal 'Opens a pop-up form to add the contact data If TempVars!JustCameFromContactsLight = 1 Then ' This is a flag from the pop-up form Me.Combo242 = TempVars!ContactID Me.Combo242.Requery ' Here is get the error "You cannot requery because the control has not been saved" TempVars!ContactID = "" ' This resets the TempVars End If TempVars!JustCameFromContactsLight = 0 ' This resets the flag End If Response = acDataErrContinue
Any help is appreciated
Jeff