Event Procedure Now Erroring with data type mismatch

quest4

Registered User.
Local time
Today, 18:23
Joined
Oct 12, 2004
Messages
246
Good after noon, well I am almost done and would you know it I now have an error in an event procedure. I did change the record type from number to text for the DoctorID to get something else working correctly and now when I open theis form and give it a valid DoctorID, it now tells me there is a data type mismatch in this procedure:
Private Sub Form_Open(Cancel As Integer)
Dim myDrNumber As String

Response = MsgBox("Would You Like to Issue a New Doctor No.", vbYesNo + vbDefaultButton2, "New?")
If Response = vbYes Then
DoCmd.GoToRecord , , acNewRec
Forms!frmDoctors!DoctorName_First.SetFocus
ElseIf Response = vbNo Then
myDrNumber = InputBox(Prompt:="What is the Doctor No?")
If myDrNumber = Empty Then
MsgBox Prompt:="You Did NOT Enter a Doctor No."
DoCmd.Close
Else
Me.RecordsetClone.FindFirst "[DoctorID]=" & myDrNumber <----
If Me.RecordsetClone.NoMatch Then
MsgBox "Couldn't Find Doctor No." & myDrNumber
DoCmd.Close
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End If
End If

End Sub
The debugger hi lites the line where the arrow is, so can anyone tell me what I did wrong besides change the record type in the table? Tahnk you very much to anyone who answers this problem for me.:confused::eek:
 
Quest,

Me.RecordsetClone.FindFirst "[DoctorID] = '" & myDrNumber & "'"

Wayne
 
Thank you very much WAtne, that did the trick and it now works like a charm.
 

Users who are viewing this thread

Back
Top Bottom