Access DoCmd.Open Report is hanging...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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!
 
Back
Top