Results 1 to 7 of 7

Thread: data type

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    I am getting a message that I have a 'data type error in criteria expression'. In the Access database, the issuenumber is defined as an autonumber, which is a long integer. The variable gintIssueNumber is define as 'Long' in a public statement.

    This is the line that is giving me the error:

    rst.Open "Select * from tblLog WHERE issuenumber = '" & gintIssueNumber & " ' ", cnn


    This is the code that fills 'gintissuenumber':

    gintIssueNumber = cboIssue.Text

    Is the '.text' giving me the problem? If so, what can I use in its place?


    smh
    Normal is boring...

    smh

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    This better not be a spelling problem

    Try using CLng(cboIssue.Text) - although this should cast anyway

    AND take the spaces out of your SELECT statement "'" not " ' " at the end.

    If that does not work, try taking out the single quotes altogether.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    Thanks...

    You are the best! I'd marry you, if I wasn't already!

    I removed the single quotes and it worked.

    (By the way, it REALLY wasn't my spelling...it was the interns!)
    Normal is boring...

    smh

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Blush!

    I just hope you are of the female gender

    Paul.

    P.S. I'm married too and I have four kids to prove it!

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  5. #5

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    Yes I am

    Yes, I am of the female gender, and I have one son too. I'm stopping at 2 though! The next one's going to be a girl I hope.

    Ha!

    smh
    Normal is boring...

    smh

  6. #6
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    Hmmm. Be careful

    That's how we ended up with four - two boys (three years and two years) so just one more try for girls - twin born on 4 September

    Highly recommend it.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  7. #7

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    If I'm lucky...

    Hopefully I will be lucky. Tripletts run on my side of the family, so I may just possibly end up with 4.

    Even if the next one is a boy again, I'm done... I can't even imagine how much work twins are, when my 1 is a terror himself. (And he's only 9 months old! (Just learned how to crawl and he wants to tear anything and everything apart))

    Got a lot of respect for ya!

    smh
    Normal is boring...

    smh

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