Results 1 to 4 of 4

Thread: Help with data type error...

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    34

    Question

    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

  2. #2
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Autonumber is a number not a string.

    Try the following ....

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

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    34

    Wink Thanks

    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

  4. #4
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Red face

    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"

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width