Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Canton, Ohio, USA
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL UPDATE Statement for Access (2000)

    Without making this too long, I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL UPDATE Statement for Access (2000)

    What code do you use to execute the SQL statement? To see if the update statement will do anything, do it temporarily like this:

    DoCmd.RunSQL sSQL

    You should get two warnings: that you're about to execute an action query, and that you're about to update n records.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Canton, Ohio, USA
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL UPDATE Statement for Access (2000)

    Thanks for the reply Hans!

    It gives me a run-time error that reads

    Run-time error '3075':
    Syntax error (missing operator) in query expression 'fldBedID='.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL UPDATE Statement for Access (2000)

    That means that IbedID is blank.
    - Are you absolutely sure that this is the name of the field/control on the form (watch out for typos; if necessary, type it anew.)
    - If the name is correct, are you absolutely sure that it has a non-blank value on the form?

  5. #5
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Canton, Ohio, USA
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL UPDATE Statement for Access (2000)

    Hans, you inspired me. I got it to work. The only thing now is a screen comes up and tells you that you are about to update 1 record and do you really want to do it. So is there anyway to stop the message from coming up just for this operation?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL UPDATE Statement for Access (2000)

    That is fine. When you're sure it works OK, change

    DoCmd.RunSQL sSQL

    to

    CurrentDb.Execute sSQL

    This will not prompt you about the update. Alternatively, you could use

    DoCmd.SetWarnings False
    DoCmd.RunSQL sSQL
    DoCmd.SetWarnings True

Posting Permissions

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