473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VBA for printing a query's dynaset?

MLH
Without building a report, can VBA simply print
a query's dynaset - much in the same manner
one would by opening the query manually from
the database window and clicking File, Print?
Apr 12 '06 #1
3 4122
MLH
I was thinking along the lines of...

DoCmd.OpenQuery "_Query4", acViewNormal
DoCmd.DoMenuItem acFormBar, acFileMenu, acPrint, , acMenuVer70

.... but it didn't work for me.
Apr 12 '06 #2
MLH
This is as close as I can get to it...

Private Sub Command0_Click()
DoCmd.OpenQuery "_Query4", acViewNormal
DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70
DoEvents
SendKeys "~", True
DoCmd.DoMenuItem acFormBar, 0, 3, , acMenuVer70
End Sub

That isn't working either. Can't get past the Printer Dialog box.
Apr 12 '06 #3
On Tue, 11 Apr 2006 21:48:39 -0400, MLH wrote:
This is as close as I can get to it...

Private Sub Command0_Click()
DoCmd.OpenQuery "_Query4", acViewNormal
DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70
DoEvents
SendKeys "~", True
DoCmd.DoMenuItem acFormBar, 0, 3, , acMenuVer70
End Sub

That isn't working either. Can't get past the Printer Dialog box.

DoCmd.SelectObject acQuery, "qryNMame", True
DoCmd.PrintOut , , , , 1
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Apr 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
I am having performance issues on a SQL query in Access. My query is accessing and joining several tables (one very large one). The tables are linked ODBC. The client submits the query to the...
3
by: MLH | last post by:
I don't want user to see the open query in a datasheet view. I just want the dynaset written to c:\myfile.xls. I was thinking... DoCmd OpenQuery "qryAFAexcelExportData", A_NORMAL, A_READONLY...
4
by: John | last post by:
Hi All, I have a problem making changes to a query. The query is extracting data from three different tables, but when I run the query in a form or datasheet view I can't make any changes to the...
9
by: MLH | last post by:
I have a database (datatrek.mdb) with a table named DATA. The table has a date/time field with default value = Now(). It has 100 records in it entered over a 50-minute period. I would like the...
3
by: MLH | last post by:
If there is a table (tblCorrespondence) with a field in it named and I am extracting a dynaset of records having a value of "05" in the field - Lets say the query displays field and field....
3
by: turtle | last post by:
I have Two tables (Table1 and Table2). Both tables have a common field called part number. Table 1 contains an extra field that i would like to update table 2 to match if the part number matches....
3
by: Bill Hutchison | last post by:
I have a query that returns different results (3508 rows for snapshot, 6288 for dynaset) and that is the only thing I change to get the different results. When I try to make a table from the...
1
by: MLH | last post by:
I have tblClusters containing names of corporations. I have tblAdmin containing individual store names. Each cluster can have many stores in tblAdmin. I have tblVehicleJobs containing automobile...
27
by: MLH | last post by:
How can I turn the following into a make-table query? SELECT & " " & AS Recipient FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID WHERE...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.