PDA

Click to See Complete Forum and Search --> : Help with data type error...


wick77
Jul 14th, 2000, 11:36 AM
I am having a problem with the FindFirst command.

Code:
Data2.Recordset.FindFirst "clientId = '" & CStr(Text3.Text) & "'"

clientId is an autonumber, it gives me an error saying its a data type mismatch even though im converting it to a string.

Any help would be greatly appreciated, thanks,
Wick

Stevie
Jul 14th, 2000, 11:45 AM
Autonumber is a number not a string.

Try the following ....


Data2.Recordset.FindFirst "clientId = " & Text3.Text

wick77
Jul 14th, 2000, 11:54 AM
I knew autonumber was a number, I was trying to convert that number into a string because I thought that findFirst was looking for a string. Thanks for the help, I didnt even know you could code FindFirst that way.

Cheers...
Wick

honeybee
Jul 15th, 2000, 03:18 AM
I think you should be explained how you can manipulate the data types.

While retrieving data, if you want it to be in a specific case/format, you have to embed the formatting function in the query you are framing, such as

"Select UPPER(<Column Name>) from <table name> ..."

Once you have a recordset and then if you want to manipulate the case of the values, you can use


UCase(recordset.fields(n).value) = "MY NAME"