Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto select yes on running queries.

Status
Not open for further replies.

Lorimare

MIS
Dec 9, 2003
24
0
0
US
I'm running queries in code using the DoCmd.openquery command(s) some are delete queries and some are appends. Basically everytime a query runs the dialog box pops up asking whether to run this query or not.

My question is...in code is there any way I can autoselect 'yes' every time a message box pops up?

Thanks in advance.

Also is there any way to do this running macros that run the queries?
 
in your code, before you run queries, put

docmd.setwarnings false

This will solve that.

Put Docmd.Setwarnings true afterwords to make things normal.

ChaZ

Ascii dumb question, get a dumb Ansi
 
You could manually shut of the "Action Query" confirmation in the DB, or shut it off before calling the queries, then turn it back on at the end of the code.

If you want to manually shut it off, Go to Tools -> Options -> Edit/Find and uncheck the Confirm Action Queries.
 
I am relatively new to Access 2003. Due to my limited experience with VBA I pretty much do everything using the Access 2003 functionality.

I created a query, using a where clause for the mailout date, Between [Enter Start Date (mm/dd/yy)] And [Enter End Date (mm/dd/yy)}. The user is prompted for a Start and End Date which results in the records that are retrieved. I would like to display this date range on my report however am having trouble building an expression that will work.

I tried entering ="Between [Enter Start Date (mm/dd/yy)] And [Enter End Date (mm/dd/yy)]" in a text box in the Report header however that didn't work.

Is there an easy way to display the date range on the report without having to write VBA code?

P.S. I checked the forum and couldn't find a reply that matched my enquiry.

Thanks,



 
In the query grid.
StartDate: [Enter Start Date (mm/dd/yy)]
EndDate: [Enter End Date (mm/dd/yy)]

Now the report has access to 2 new fields on each record.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV. I hope I am posting properly.

Would I put the following in the field or in the criteria.
In the query grid.
StartDate: [Enter Start Date (mm/dd/yy)]
EndDate: [Enter End Date (mm/dd/yy)]

I tried to put it in the criteria however got the following error. "The expression you enter has an invalid .(dot)or ! operator or invalid parentheses.

Thanks again for your help.
 
PHV said:
Now the report has access to 2 new fields on each record
I don't said you have new criteria but new fields ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top