Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    18

    Unanswered: How do I turn this setting off

    I have turned off the action query function in the edit/find tab?


    How do I turn this msg box off so I can run this update query without having to click the box??
    Attached Thumbnails Attached Thumbnails error.JPG  

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    three ways
    turn off warnings as part of the settings
    wrap "set warnings OFF" before the query "set warnings ON" after the query
    don't do it

    the first is NOT reccomended it leaves you wide open to problems
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    and a fourth:
    currentdb.execute strSQL

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Use Izy's suggestion over SetWarnings every time in a million (maybe even a billion)
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2005
    Posts
    18
    Thanks Alot.

    I was able to use the set warnings method which you don't recommened. I did it in a macro. Set warnings off...open query...set warnings on

    How would I use the Currentdb.excute function.??I would use some type of event handler?? example below??

    Private Sub Form_Open(Cancel As Integer)
    CurrentDb.Execute (What do I put here??)
    End Sub

    Thanks again for your help

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    currentdb.execute "DELETE * FROM myTable;"

    currentdb.execute is looking for some literal SQL (or a string variable holding SQL) ...similar stuff to what you see in SQL-view of your saved query, but unfortunately not 100% identical so you can't just do a simple copy/paste.

    given that you are using macros and that a significant percentage of the questions on this site are to do with broken SQL, maybe you should stay with setwarnings for the moment. probably we would not have suggested .execute for your macro/savedQuery situation if we had known. try to review other peoples SQL problems here for a week or two - you'll soon see how it goes.

    the downside of setwarnings is that it is global. if something unexpected happens between the setwarnings False and the setwarnings True (for example, your query errors), your warnings are off everywhere - even where you didn't intend to turn them off.

    if you are later tempted to try some code that uses:
    docmd.setwarnings False
    docmd.runsql strSQL
    docmd.setwarnings True

    do yourself a favour - compare execution time with:
    currentdb.execute strSQL

    izy
    currently using SS 2008R2

  7. #7
    Join Date
    Feb 2005
    Posts
    18

    Thanks Izy, Your quick reply is appreciated

    Thanks For your help.
    I will stay with the Set Warnings for now.

    I will be slowly migrationg form access to SQL server. So I will certanilly pay attention to true SQL.

    Do you know of any good starting resources for SQL?
    Books??
    Other web sites??(This site has been a great resource for me)

    Thanks Again

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by Cbauer
    T.....true SQL.....
    Aaah 'True SQL' that mythical beast that exists only in the ANSI / ISO SQL standards.

    There is no "true" implmentation of SQL, each database vendor has a product which comes close but doesn't meet the SQL standards. Usually where they don't match the standards the differences are fairly minor sins of omission. Most vendors have additional features that are not part of the spec. Some features are legacy issues hanging over form previous versions of their product.

    SQL Server is a SQL server, its not THE SQL server. It is not the defintiive implementation of SQL. It has many competitors, it has both strengths and weakenesses.

    If your aim is writing generic SQL then often you loose some of the features of the sepcific database implementation
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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