data type mismatch

cadillac

Registered User.
Local time
Today, 17:57
Joined
May 9, 2001
Messages
34
i just imported some records into my table and now my form gives me a data type mismatch error. here is the code.

Private Sub find_it_AfterUpdate()
Dim customers As Recordset, sqltext
sqltext = "select * from [customers] where " _
& "[customer number]= " & Me![customer number]
Set customers = CurrentDb.OpenRecordset(sqltext)
Me![name] = customers![name]
Me![address1] = customers![address1]
Me![address2] = customers![address2]
Me![address3] = customers![address3]
Me![city] = customers![city]
Me![state] = customers![state]
Me![zip] = customers![zip]
Me![prepaid carrier] = customers![prepaid carrier]
Me![collect carrier] = customers![collect carrier]
Me![fax number] = customers![fax number]
DoCmd.OpenForm ("terms popup")
End Sub

it worked fine before. the only thing i changed was the data type in the zip and customer number fields. they were changed from number to text to allow the new data to be used.
 
If 'customer number' field is now text then change the following line in your code:

"[customer number]= '" & Me![customer number] & "'"
 

Users who are viewing this thread

Back
Top Bottom