View Full Version : type mismatch error


adj
08-01-2000, 08:24 AM
Hello again,
I am getting a type mismatch error.
On my form,
a combo box
text box(enter new date)
text box(enter description)---this is where the type mismatch error is occuring.
here is the code.

Private Sub Next_Week_Exit(Cancel As Integer)
If IsNull([Next_Week]) Then
Else
n = Len([Next_Week])
While n > 0
If Mid$([Next_Week], n, 1) > Chr$(48) And Mid$([Next_Week], n, 1) <= Chr$(57) Then
ans = 0
For x = 48 To 57
If Mid$([Next_Week], n - 1, 1) <> Chr$(x) And Mid$([Next_Week], n + 1, 1) <> Chr$(x) Then
Else
ans = ans + 1
End If
Next x
If ans = 0 Then
prev = Mid$([Next_Week], 1, n - 1)
aft = Mid$([Next_Week], n)
[Next_Week] = prev & "0" & aft
End If
End If
n = n - 1
Wend
End If

End Sub


Please help.
Anne

Neo90815
08-01-2000, 12:07 PM
Hi,

I had the same error message. My relationship was wrong. My two fields on the form were from two different tables and I had link the relationship improperly; one field from a table is type text and another field from another table type number; Access did not like that.. I changed the relationship and that error message went away...

Good luck!

adj
08-01-2000, 12:18 PM
Thanks. Turns out, that it was a text that was being forced to return a string, and i didn't have anything that had the value i was trying to type.

Anne