Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2005
    Posts
    196

    Unanswered: Update Query Error Message

    I have created the following query in sql:

    Code:
    UPDATE BackupProductMajorMinorStoc SET BackupProductMajorMinorStoc.CS = "", BackupProductMajorMinorStoc.SP = "";
    It's throwing up an error message saying no records will be updated due to a conversion type failure. I presume this is because I'm trying to set the value in the fields as blank (intentional). When you say 'Yes' to continuing with the query, it runs as intended. Is there anyway you can bypass the error message? Cheers.
    Last edited by Fuerteventura; 12-09-05 at 12:00. Reason: Wrong title

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Are those numeric fields you're updating? You're trying to set them to zero-length strings.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Aug 2005
    Posts
    196
    They are numeric - would you recommend changing to text or is there any way round it? It does perform the query perfectly, I just don't want it to come up with that message everytime I run it, cheers

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What about setting them to 0?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Aug 2005
    Posts
    196
    Wish I could - but there are user issues which make this a dangerous thing to do!

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Well ok, sounds like you have some questionable design going on here... but try this:

    DoCmd.SetWarnings False
    DoCmd.Execute(yourQuery)
    DoCmd.SetWarnings True 'FOR THE LOVE OF ALL THAT IS HOLY, DO NOT FORGET THIS LINE
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so if you can't use 0, then assigning null may be appropriate

  8. #8
    Join Date
    Aug 2005
    Posts
    196
    Thank you both very much for your further replies - Teddy, that's working just great now - cheers mate.

Posting Permissions

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