Try this code:
'-------------------------------
Private sub PrintAccessReport()
Const dbPathName = "C:\DB1.MDB"
Dim Acc As Object, db As Object
Set Acc = CreateObject("Access.Application"
Set db = Acc.Application.DBEngine.Workspaces(0).OpenDatabase(dbPathName, 0, False)
Acc.OpenCurrentDatabase dbPathName, False
Acc.DoCmd.OpenReport "YourReportName", acPreview
Set db = Nothing
Set Acc = Nothing
Now, what if you want to do some formatting in runtime for that report, can this also be achieved?
Example:
Instead of using CrystalReports, can one do a fair amount of formatting as in changing a clients photo in VB at runtime, Font changes and style for a specific field at runtime and then when previewing, to see all those take effect?
I know I'm asking a bit here but if you can't give me the answer, could you please direct me to a place to where I can get all this?
I also do have the Microsoft Access Manual if that helps.
Or, can I find this in VB help or Books Online?
Thanks again for your time to help, greatly appreciated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.