Hello,
I'm having a problem with my latest database. One of the users keeps getting an error message that I can't duplicate. The form (frmVisit) is tied to qryVisit, tied to tblVisit. cboVstrName is the control to enter a visitors name, and has a row source of qryVstr, which is just a list of visitors names. The Limit to List is set to Yes, and the NotInList code looks like this...
Private Sub cboVstrName_NotInList(NewData As String, Response As Integer)
'Adds visitor name to table if not already on dropdown list
Dim strSQL As String
Dim Compy As String
Compy = Nz(Me.cboVstrComp)
NewData = StrConv(NewData, vbProperCase)
DoCmd.SetWarnings False
strSQL = "INSERT INTO tblVstr (VstrName, VstrCmpny)"
strSQL = strSQL & "VALUES ('" & NewData & "', '" & Compy & "');"
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Response = acDataErrAdded
End Sub
When I enter a name in the combobox that isn't already in the source table, the first & last names are capitalized, and they are saved in tblVstr, and the data is correctly saved in tblVisit. I've entered 2 pages of names with no problems or errors. Today I watched one of the users enter names (the exact same way I was entering them), and after 2 or 3 entries, she would get a message on the cboVstrName control saying something like "the value you entered is not in the list. You must enter a value from the list." I entered another page of names tonight, and never got the message at all, everything worked perfectly.
Any suggestions?