Data type mismatch

barboza

Registered User.
Local time
Today, 13:20
Joined
Aug 22, 2007
Messages
23
The following line of code works:
Set rst = dbs.OpenRecordset("select [PWSNAME] from Client where [ClientNum] = '9190';")

The following line of code gives the error described after the code below:

Set rst = dbs.OpenRecordset("select [PWSNAME] from Client where [ClientNum] = " & Me.ClientNum & ";")

When I replace 9190 with the Me.ClientNum I get datatype mismatch error. If you hold the mouse over Me.ClientNum the figure 9190 shows as being in the field.
Anybody have any idea what is happening??

Thanks,

barboza
 
Sure; note the single quotes around your working hard-coded value that aren't around the failing value.
 

Users who are viewing this thread

Back
Top Bottom