Append queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ckpoll2
    New Member
    • Sep 2006
    • 76

    #1

    Append queries

    Hello,

    Is there a way to get rid of the information boxes when I run an append query? I wand to use it as part of a macro that just happens when it is clicked, but I don't want the user to have to hit OK and Yes to a bunch of information boxes. How can I get rid of this necessity?

    Thanks,

    Charlie
  • ckpoll2
    New Member
    • Sep 2006
    • 76

    #2
    I just realized that I said append queries, but I actually meant update queries. Any suggestions?

    Comment

    • Denburt
      Recognized Expert Top Contributor
      • Mar 2007
      • 1356

      #3
      BE CAREFULL with the setwarnings you might find yourself deleting things and not receiving a prompt.



      DoCmd.Hourglass True
      DoCmd.SetWarnin gs False

      Your Code here

      DoCmd.Hourglass False
      DoCmd.SetWarnin gs True

      Comment

      • ckpoll2
        New Member
        • Sep 2006
        • 76

        #4
        I'm not sure I understand. The SQL code I have is:

        DELETE [Personal Property Hours].[Transaction Number ID], [Personal Property Hours].Date, [Personal Property Hours].Name, [Personal Property Hours].Site, [Personal Property Hours].Type, [Personal Property Hours].[Tech Input Items], [Personal Property Hours].Items, [Personal Property Hours].Hours, [Personal Property Hours].Notes
        FROM [Personal Property Hours]
        WHERE ((([Personal Property Hours].Type) Is Null));

        When I put the top section above it and the bottom below, it gives me an error message. What am I doing wrong?

        Comment

        • Denburt
          Recognized Expert Top Contributor
          • Mar 2007
          • 1356

          #5
          What does the error message say? Also if there is a debug button hit it and tell me what line is highlighted.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            The docmd statement is risky as it will (after a dump) stay active.

            Personally I prefer to run the query from code like:

            currentdb.execu te ("<place your query text here within the quotes>")

            This won't trigger the messages and not have the disadvantage of the docmd statement.

            Nic;o)

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by ckpoll2
              I'm not sure I understand. The SQL code I have is:

              DELETE [Personal Property Hours].[Transaction Number ID], [Personal Property Hours].Date, [Personal Property Hours].Name, [Personal Property Hours].Site, [Personal Property Hours].Type, [Personal Property Hours].[Tech Input Items], [Personal Property Hours].Items, [Personal Property Hours].Hours, [Personal Property Hours].Notes
              FROM [Personal Property Hours]
              WHERE ((([Personal Property Hours].Type) Is Null));

              When I put the top section above it and the bottom below, it gives me an error message. What am I doing wrong?
              In a delete query you cannot decide to delete certain columns you have to delete the whole record. In other words ...

              Code:
              DELETE * FROM [Personal Property Hours]
              WHERE ((([Personal Property Hours].Type) Is Null));
              Mary

              Comment

              Working...