Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Report Preview When Access Shell Hidden

Status
Not open for further replies.

TimTang

Technical User
Jun 24, 2002
132
TH
Hello All,

I'm currently using the VB mod that hides the Access shell so that the forms appear on screen cleanly without the messy background. I think it looks much more professional and less confusing to users this way.

I've got some report previews that are selected from the form, but when ever I select them they don't appear. They do appear when I open the database normally through the Access shell but I don't want users to have to go through this procedure just to view a report.

Is there some way to make report previews appear without the Access shell, the same way as the forms do?

Thanks in advance for any assistance.

Cheers!!
 
Assuming you mean an .mde, what is the code you are using to preview the form?

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Warning: If you're hiding the main Access window, make sure your error handlers are good. Because with the window hidden, if an error is raised, pressing "End" on the Error window will NOT make Access window visible and you will be left with just the form open. A recommended method is to make a call to fSetAccessWindow with SW_SHOWNORMAL from your error handlers.

First, did you do this, and if so, were there any errors raised?

Second, the report opened in acPreview (I assume that is what you're doing, as you didn't post back any code from the form) opens in the database window, which you have hidden. If you need your end users to have a "clean" environment, create an mde and distribute that instead of the mdb.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Hi Genomon,

I haven't tried what you recommended because I'm not sure where I would put it. Should this be included with each form and report or is there a single location which would ba a catch all?

I'm hoping to eventually split the data base into front end and back end but it's still not quite ready for prime-time. Currently I'm the only one using it.

Would the front end be converted to MDE? I haven't had any experience with this yet.

I would like to keep the back-end on a server.
 
Hi again,

I should have mentioned that when I call up a report with the Access shell hidden I don't get any errors. I just can't do anything from that point forward, and the only way to close the database is with the task manager.

Presumably the report is opened inside the shell hiding in the same place the shell is.

I'm kinda suspecting that reports can't be shown with out the shell, but I could be wrong.

Here is the code behind the CMD buttom for one of the report:

Code:
Private Sub cmdCargoByAcct_Click()
On Error GoTo Err_cmdCargoByAcct_Click

    Dim stDocName As String
    Dim Msg As String, Style As Integer, Title As String, DL As String
    Dim strAccount As String
      
    strAccount = Me.cboAccount.Column(1, strAccount)
    gblAccount_ID = Me.cboAccount.Column(1, strAccount)
    
    DL = vbNewLine & vbNewLine
    Msg = "Would you like to preview the cargo report " & DL & _
          "For '" & strAccount & "'"
    Style = vbQuestion + vbYesNo
    Title = "Cargo by Account..."
    
    If MsgBox(Msg, Style, Title) = vbYes Then
    stDocName = "rptCargoByAccount"
    DoCmd.OpenReport stDocName, acPreview
    
    Else
      Exit Sub
      
    End If

Exit_cmdCargoByAcct_Click:
    Exit Sub

Err_cmdCargoByAcct_Click:
    MsgBox Err.Description
    Resume Exit_cmdCargoByAcct_Click
    
End Sub

Cheers!!!

And thanks for the assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top