Access DoCmd.Open Report is hanging...

A

AndyK

hi - if someone could help with this that would be great - I must be doing something stupid :-

I have a VB6 form (relevant code below) which on load populates a list of available reports, then when the user selects one & clicks OK tries to do a DoCmd.Open Report - but the code hangs on that line and I have to stop the msaccess.exe process in Task Manager.

Thanks for any help

Option Explici

Private mobjAccessApp As Access.Applicatio
Private mobjAccessReport As Access.AccessObjec

Private Sub Form_Load(
' populate list of report
Set mobjAccessApp = CreateObject("Access.Application"
mobjAccessApp.Visible = Fals
mobjAccessApp.OpenCurrentDatabase gstrdbFolder & "St Columba.mdb

For Each mobjAccessReport In mobjAccessApp.CurrentProject.AllReport
lstReports.AddItem mobjAccessReport.Nam
Nex
End Su

Private Sub cmdOK_Click(
mobjAccessApp.DoCmd.OpenReport lstReports.Tex
mobjAccessApp.CloseCurrentDatabas
End Sub
 
V

Van T. Dinh

Reports are shown in the Access Application window but you made the Access
Application window invisible earlier!

I think Dirk Goldgar experimented with showing Access Reports outside the
Access Application window and he managed to do it but then got error or
hang-up on closing the Report.

--
HTH
Van T. Dinh
MVP (Access)



AndyK said:
hi - if someone could help with this that would be great - I must be doing something stupid :-(

I have a VB6 form (relevant code below) which on load populates a list of
available reports, then when the user selects one & clicks OK tries to do a
DoCmd.Open Report - but the code hangs on that line and I have to stop the
msaccess.exe process in Task Manager.
 
A

AndyK

thanks for the response

My problem now is how to have the Access application visible but stop the users opening db tables, queries etc..

I will check this out - but any pointers gratefully received!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top