kellan4459
Registered User.
- Local time
- Today, 14:45
- Joined
- Nov 26, 2001
- Messages
- 31
Here is my code:
Private Sub Combo35_NotInList(NewData As String, Response As Integer)
Dim db As Database, rs As Recordset
Dim strMsg As String
strMsg = "'" & NewData & "' is not an available Social Security Number."
strMsg = strMsg & " Click Yes to Add or No to re-type it."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new name?") = vbNo Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("EmployeeData", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Combo35 = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub
Here is my error:
Run-time error 13:
Type Mismatch
what might cause this?
Private Sub Combo35_NotInList(NewData As String, Response As Integer)
Dim db As Database, rs As Recordset
Dim strMsg As String
strMsg = "'" & NewData & "' is not an available Social Security Number."
strMsg = strMsg & " Click Yes to Add or No to re-type it."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new name?") = vbNo Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("EmployeeData", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Combo35 = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub
Here is my error:
Run-time error 13:
Type Mismatch
what might cause this?