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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA codes to execute append queries and produce a report

Status
Not open for further replies.

navdha88

Programmer
May 1, 2003
8
0
0
CA
Hi everyone:

I posted the same question and did'nt receive any reply. May it was not that clear. I explained some more in here.
The problem is as follows:

I have 7 tables. I created 7 append queries with the two necessary fields, userid and Date. I created a form with 2 textboxes txtfromdate and txttodate and a command button.

Once the user enter the fromdate and todate in the textbox and press the command button, I want the 7 append queries to be executed and also to be saved to one seperate table.
Also a report should produce for the same. I would really appreciate if anybody could give me the codes for this.

Thank You
 
If you want to run queries, use
DoCmd.RunSQL

If you want to open reports, use
DoCmd.OpenReport

If you need to tie all this to the command button, use the "Click()" event of the command button and put all the code there.


If you want to filter specific reports, pay close attention to the "filter" argument for the OpenReport command.




Otherwise check the help files. It looks like you know what you're doing but haven't bothered to look at the help files--once you've made a stab at the problem, post your code with specific problems and someone can help you with your specific problems. For general howto's the help files are a much better resource (they even have examples!).



--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
Alternatively, you can use a macro. Use 7 OpenQuery actions to update your tables and another one to save stuff to a seperate table. Then use OpenReport to open your report. The report itself probably has its own recordsource already, I assume. Now put this macro under the onClick event of your button.


Bye,
Jeroen

A 3d level editor in Delphi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top