Ms Access Autonumber Query RRS feed

  • Question

  •  s = "update Color set  Color='" & ListView1.Items(y).SubItems(5).Text & "' where ID='" & CInt(ListView1.Items(y).SubItems(1).Text) & "' "

    i have written this code and the ID field in the last is an autonumber and i am unable to query database as it shows datatype mismatch every time.

    i ve also tried Cint()  but it fails to work .  Kindly suggest something to get out of this probs.

    Thanks in Advance

    Thursday, October 1, 2009 3:20 AM


  • Its hard to tell with pasted code ... but I believe you use single quotes around string values but NOT around integer values.

    So the resulting Update statement (after your variables are processed) would look something like this:

    Update Color set Color = 'mycolor' where Id = 7

    Hope this helps.
    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    • Proposed as answer by Cor Ligthert Thursday, October 1, 2009 6:22 AM
    • Marked as answer by zafar_bdk Thursday, October 1, 2009 1:35 PM
    Thursday, October 1, 2009 4:38 AM