I've defined the following function as an event procedure in the On Not in List:
Private Sub cboLastname_NotInList(NewData As String, Response As Integer)
Dim rs As Recordset
Dim db As Database
If MsgBox(UCase(NewData) & " is not in the list of Authors." & vbNewLine & "Enter it as new Author?", vbYesNo + vbQuestion,
"Confirm.") = vbYes Then
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCitationAuthor")
rs!CitationAuthorLastName = NewData
Response = acDataErrAdded
Set db = Nothing
Response = acDataErrContinue
The problem is that it does not trim the string before comparing the not in list. Is there a way to trim before the
even procedure runs? To clarify what I mean it currently evaluates "Bob" and "Bob " as two different strings, I'd like to
use the trim function before the check on not in list.
Any advice is greatly appreciated.