none
Data Type Mismatch RRS feed

  • Question

  • I feel like this error is self explanatory with checking the ... whats it called... datatype haha (trying to make light of my frustration)

    im getting this error and Ive checked most everything I can think of. would any one have any suggestion as to why/how the error is thrown.

    Friday, July 27, 2018 5:05 PM

Answers

  • Both POrderNumber and Projman return a number (their respective primary keys or IDs)

    Hi jshot,

    You declared Projman as a String, whereas it returns a number? This should not raise an error however, because Access can accept numbers in a string.

    But what datatype is  Me!ProjectManager? If it is numeric, no single quotes are needed. Single quotes are only necessary with String types.

    Imb.

    • Marked as answer by jshot Friday, July 27, 2018 7:50 PM
    Friday, July 27, 2018 6:42 PM

All replies

  • Hi jshot,

    Which line gives the error?

    How is the variable  username  declared? Or is this a Control on the form?

    Because of all the misery with spaces in the names of Tables and Controls, I NEVER use spaces in names. So I can be wrong, but needs the Table name "Employees Extended" also to be bracketed?

    Imb.

    Friday, July 27, 2018 5:36 PM
  • Dang my apologies... its the Apprtype (approval type) line.

    I completely understand about the spaces. Most of the nomenclatures throughout my db was in it when I "inherited it".

    Both POrderNumber and Projman return a number (their respective primary keys or IDs)

    Friday, July 27, 2018 5:42 PM
  • Both POrderNumber and Projman return a number (their respective primary keys or IDs)

    Hi jshot,

    You declared Projman as a String, whereas it returns a number? This should not raise an error however, because Access can accept numbers in a string.

    But what datatype is  Me!ProjectManager? If it is numeric, no single quotes are needed. Single quotes are only necessary with String types.

    Imb.

    • Marked as answer by jshot Friday, July 27, 2018 7:50 PM
    Friday, July 27, 2018 6:42 PM
  • Hi,

    Pardon me for jumping in, but how about trying to change all your lines where you have something like:

    ..., "[ID] = '" & Me!blah_blah & "'")


    to something more like this?

    ..., "[ID] = " & Me!blah_blah)

    Please note I removed the single quotes.

    Hope it helps...

    PS. I meant, only change the ones where you're expecting a number. I suppose the username and employeename would be fine with the single quotes left intact.

    Cheers!

    • Edited by .theDBguy Friday, July 27, 2018 6:48 PM PS
    Friday, July 27, 2018 6:46 PM
  • Getting rid of the single quotes worked. You both were right. Thank you both a million.
    Friday, July 27, 2018 7:51 PM
  • Getting rid of the single quotes worked. You both were right. Thank you both a million.
    Congratulations! Glad to hear you got it sorted out. Good luck with your project.
    Friday, July 27, 2018 8:05 PM