By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Access reporting

P: 1
I have a requirement where I need to open up an access report on the click of a button which resides in a dotnet windows application.

This is a dynamic report with grouping. and the report has 2 buttons. Export and Print. Onclick of the export button I need to export the report data to XML.
On click of the Print button I need to print the report using the default printer set.

Can anyone pls guide me to do these. :1) Call the report from a windows app. 2)export the data to xml and 3) Print the data report.

Thanks in advance for your help. I am pretty new to Access as in my 5 years of experience I have never worked with Access. Any help is greatly appreciated.
Thanks Follks !
Mar 15 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,072
To open another application you cab use in the OnClick code for a button the Shell command like:

shell "c:\windows\notepad.exe"

The buttons on the application for printing/exporting are however "out of reach" for your Access application.

Mar 17 '07 #2

Expert 100+
P: 1,356
The PC I am currently on does not have DotNet installed so i am not able to test this.
I do believe that if you set a reference to Microsoft Access X.x Object Library. You should be able to use something to the effect of:
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Dim MyAcc As Access.Application
  4. Private Sub Command1_Click()
  5. 'For Printing
  6. MyAcc.DoCmd.OpenReport "My Report"
  7. 'For exporting to XML
  8. 'MyAcc.ExportXML(ObjectType, DataSource, DataTarget, SchemaTarget, PresentationTarget, ImageTarget, Encoding, OtherFlags, FilterCriteria, AdditionalData) 
  10. End Sub
  12. Private Sub Form_Load()
  13. Set MyAcc = New Access.Application
  14. MyAcc.OpenCurrentDatabase "C:\MyPath\MyDB.mdb"
  15. End Sub
  17. Private Sub Form_Unload(Cancel As Integer)
  18. MyAcc.CloseCurrentDatabase
  19. Set MyAcc = Nothing
  20. End Sub
Mar 20 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.