I don't have Crystal Reports, and Data Reports in VB is rubbish. Does anyone know if you can create reports in Access 97 and then call them from VB6? If so how....
I used this code to open a report from Visual Basic in Access. Hope this helps.<br>
<br>
Private Declare Function apiSetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long<br>
Private Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal ncmdshow As Long) As Long<br>
Private Const SW_MAXIMIZE = 3<br>
<br>
<br>
Public Sub CreateReport()<br>
Dim objAccess As New Access.Application<br>
<br>
Set objAccess = New Access.Application<br>
<br>
With objAccess<br>
<br>
.OpenCurrentDatabase ("{path of database}")<br>
<br>
.DoCmd.OpenReport rptName, 2<br>
<br>
.DoCmd.SelectObject 3, rptName <br>
.DoCmd.Maximize<br>
<br>
lngret = apiSetForegroundWindow(.hWndAccessApp)<br>
lngret = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)<br>
lngret = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)<br>
<br>
End With<br>
End sub
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.