Append Query with NO UI (1 Viewer)

thudson

Old Programmer
Local time
Today, 01:53
Joined
Apr 29, 2011
Messages
68
I am trying to create a query to check 12 dates which are in 2 tables, using the expression Between Now() And Now() +30. I did not want the user to have to have any user input, so I created 12 queries for each of the fields that needed to be checked. I ran all of these queries in a Macro, but each query requires 2 user inputs which I am trying to avoid.
I am dumping this data into a tempory table, from which I want to create a report.
Background: The database is for a local Cat Charity and the data I am trying to work on is the dates of various vet treatments done on the cat.

Does any body know how to run the queies in 'silent mode'?

Also, is there an easy way of deleting all of the records in this query once the report has been created?
 

BobMcClellan

Giving Up Is Unacceptable
Local time
Yesterday, 20:53
Joined
Aug 1, 2009
Messages
104
I ran all of these queries in a Macro, but each query requires 2 user inputs which I am trying to avoid.?

by this... if you mean that the user is being prompted if they want to insert the data or update data... and you want to avoid these prompts.... then
(in versions prior to 2007 you can set warnings on and off as a step in the macro)
I just checked my 2007 and did not see it....
so... you can create these to functions.
Then (In your macro) use Function WarningsOff as 1st Step and WarningsOn as last step.

Function WarningsOff()
DoCmd.SetWarnings False
End Function


Function WarningsOn()
DoCmd.SetWarnings True
End Function

Be SURE the queries are doing what you expect.
hth,
..bob
 

boblarson

Smeghead
Local time
Yesterday, 17:53
Joined
Jan 12, 2001
Messages
32,059
by this... if you mean that the user is being prompted if they want to insert the data or update data... and you want to avoid these prompts.... then
(in versions prior to 2007 you can set warnings on and off as a step in the macro)
I just checked my 2007 and did not see it....
so... you can create these to functions.
Then (In your macro) use Function WarningsOff as 1st Step and WarningsOn as last step.

Function WarningsOff()
DoCmd.SetWarnings False
End Function


Function WarningsOn()
DoCmd.SetWarnings True
End Function

Be SURE the queries are doing what you expect.
hth,
..bob

You don't need to create functions for that. The SetWarnings is available from macros directly:

Action: SetWarnings
Argument: No

then the macro step for opening the queries

and then

Action: SetWarnings
Argument: Yes

Oh, and they are available in 2007 and 2010 but you have to click the button on the Ribbon which reads SHOW ALL ACTIONS.
 

Users who are viewing this thread

Top Bottom