A good way to run the Microsoft Access report in VB

xiaoxiao2021-03-06  51

On a good way to run a Microsoft Access report in VB: Unknown how to use VB intuitive and simple reporting has been a problem of concern to many people, Crystal Reports and use them less than ideal. It is now introduced that the method of running the Microsoft Access report in VB is not bad. Run the Microsoft Access Report by using Automation 1. Use Microsoft Access to create a report (such as: rptemployss). 2. Creating a reference in VB Use the "Project References" menu to create a reference to Microsoft Access 8.0 Object Library. Listing 3. Note: References MS Access 8.0 Object Library (this Note: code will work with any verson of Access that NOTE: supports Automation) Dim MSAccess As Access.Application Private sub Command1_Click () Set MSAccess = NEW Access.Application MSAccess. OpenCurrentDatabase (App.Path & "ovelty.mdb") MSAccess.DoCmd.OpenReport "rptEmployess", acViewNormal MSAccess.CloseCurrentDatabase Set MSAccess = Nothing end Sub Note: acViewNormal told Access to open and print the report immediately. This method has a disadvantage that MS Access must be installed in the operating environment.

转载请注明原文地址:https://www.9cbs.com/read-81483.html

New Post(0)