P
Pamela
Running NotInList event on cboAdjusterID to open pop up frmAdjuster and then
add the new item. Upon closing frmAdjuster, get "missing operator" error
that when debugged highlights the .FindFirst "[AdjusterID] ... line. The
combo is bound by the ID field which is a number but the box displays the
full name, which concatenates the FirstName and LastName fields, for example,
"John Doe." This then would be the same format that the user would type into
it, but then would have to separate upon entry into the frmAdjuster.
Would someone please help me find the problem with this .FindFirst procedure?
Thanks!!
Here is the code:
Private Sub cboAdjusterID_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list." & vbCrLf & "Would you like to add
" & NewData & "?", vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then
Me.cboAdjusterID.Undo
DoCmd.OpenForm "frmAdjuster", , , , acFormAdd, acDialog,
Me.InsuranceCoID
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone
.FindFirst "[AdjusterID] = " & NewData
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.cboAdjusterID.Undo
Response = acDataErrContinue
End If
End Sub
add the new item. Upon closing frmAdjuster, get "missing operator" error
that when debugged highlights the .FindFirst "[AdjusterID] ... line. The
combo is bound by the ID field which is a number but the box displays the
full name, which concatenates the FirstName and LastName fields, for example,
"John Doe." This then would be the same format that the user would type into
it, but then would have to separate upon entry into the frmAdjuster.
Would someone please help me find the problem with this .FindFirst procedure?
Thanks!!
Here is the code:
Private Sub cboAdjusterID_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list." & vbCrLf & "Would you like to add
" & NewData & "?", vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then
Me.cboAdjusterID.Undo
DoCmd.OpenForm "frmAdjuster", , , , acFormAdd, acDialog,
Me.InsuranceCoID
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone
.FindFirst "[AdjusterID] = " & NewData
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.cboAdjusterID.Undo
Response = acDataErrContinue
End If
End Sub