Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-06-2019, 07:12 PM   #16
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,149
Thanks: 15
Thanked 1,572 Times in 1,494 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Printing with Print Preview

I don't like the tab view so I always use "Overlapping Windows". I also think that most of the time, having multiple windows open just confuses users so whenever form a opens form b, form a passes its name to form b in the OpenArgs and hides hides itself
Code:
DoCmd.OpenForm "formname", , , "wherecondition if necessary", , , Me.Name
Me.Visible = False
Then in the close event of form b, check the openargs and reopen that form
Code:
    If IsNull(me.OpenArgs) Then
        DoCmd.OpenForm "Switchboard"
    Else
        DoCmd.OpenForm me.OpenArgs
    End If
And since I hate having to write this code in every close event, I actually make common procedures and call them.
Code:
Call CommonClose
Here's my real close event. It's a little more complicated because it handles another important situation which is preventing forms from closing if there are pending save errors but that's for a different thread.
Code:
    Public Sub CommonClose(frm As Form)
On Error GoTo ErrProc
    If bForceClose = True Then
        Exit Sub        'do not run close code
    End If
    If frm.Dirty Then
        DoCmd.RunCommand acCmdSaveRecord
    End If
    If IsNull(frm.OpenArgs) Then
        DoCmd.OpenForm "Switchboard"
    Else
        DoCmd.OpenForm frm.OpenArgs
    End If
    
    bForceClose = False     'reset variable
ExitProc:
    Exit Sub
ErrProc:
    Select Case Err.Number
        Case 2102   'bad open args form name
            Resume ExitProc
        Case 2455   'happens for A2007 when unbound form references the Dirty property
            Resume Next
        Case Else
            MsgBox Err.Number & "--" & Err.Description
            Resume ExitProc
    End Select
End Sub

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Old 10-06-2019, 07:37 PM   #17
Lkwdmntr
Newly Registered User
 
Join Date: Jul 2019
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Lkwdmntr is on a distinguished road
Re: Printing with Print Preview

The person that is going to be using this know absolutely nothing about access and doesn't want to see any of the access interface. It is strictly form-based and everything is full screen. There is an enter button that takes you into the program and another button that will take you out completely. This is the way the boss wants it.
Lkwdmntr is offline   Reply With Quote
Old 10-06-2019, 10:21 PM   #18
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,361
Thanks: 112
Thanked 2,843 Times in 2,593 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Printing with Print Preview

So all your forms will be full screen but you can still use overlapping windows layout.
It also doesn't answer the question I asked.
Why are you using modal, popup forms and reports?

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 10-07-2019, 02:17 PM   #19
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,149
Thanks: 15
Thanked 1,572 Times in 1,494 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Printing with Print Preview

Quote:
The person that is going to be using this know absolutely nothing about access and doesn't want to see any of the access interface. It is strictly form-based and everything is full screen. There is an enter button that takes you into the program and another button that will take you out completely. This is the way the boss wants it.
Nothing I said conflicts with your requirements. I simply told YOU how to accomplish it without using model forms which are more annoying than useful except in rare cases.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Prevent Print Preview When Printing skilche1 Forms 0 01-24-2015 07:38 AM
Printing report from print preview with ribbon jyrilepisto General 5 07-04-2014 09:12 AM
Printing from Print Preview window SirDrums Reports 5 05-30-2012 07:01 AM
Repeat Pages for Print Preview and Printing holt77386 Reports 0 08-23-2007 12:51 PM
Print Preview Wonky but Printing Correctly shewolf Reports 2 03-02-2007 03:27 PM




All times are GMT -8. The time now is 04:52 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World