1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Window Control in Access

Discussion in 'Business Applications' started by Billstan, Feb 16, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. Billstan

    Billstan Thread Starter

    Joined:
    Feb 11, 2007
    Messages:
    15
    I am trying to establish an application that will require minimum input by very unskilled users. I am frustrated in trying to provide a acceptable and consistent screen display of reports, especially when using a restricted Switchboard approach. The problems are two-fold: establishing an adequate screen window when a report opens; and avoiding problems when double-clicking a Switchboard entry.

    A previous thread in 2005 provided a pretty sophisticated way to make reports "fit" a window. But I don't want to do that because the fit option displays the entire report page with only a single zoom capability which makes my reports too small to read. All I want to do is to display the full width of a report, not the length.

    On a new invocation of Access all reports opened from the Data Base Window appear in "normal" size in an arbitrarily sized window which is far too small to show the entire report width. Dragging the edges of the window works but only applies to this report this time. Maximizing a report works fine - just what I want - and, if one report is maximized, all reports are maximized. That's fine; I could live with that although it seems like it should be possible to cause all reports to open maximized instead of normal as a default or to set the size of the normal window to fit the report and have it stay that way. Obviously there must be controls somewhere that control this action.

    The main problem is with the Switchboard. If a report is opened with a single-click, all reports display in normal view in undersized windows and, again, if one report is maximized, all reports are maximized. Again I can live with that if necessary. But, if the report is opened with a double-click (and how many people double-click automatically - I do), the results are bizarre. If the report requires entry of a parameter, it opens in normal view in an undersized window and can be maximized. If a report does not require a parameter, it opens as a full page in the same undersized window with only a single inadequate zoom option. It can then be maximized but still attempts to display the entire page length which generally makes the text too small. And there's no apparent way to overcome this.

    So what's a girl to do?

    To compound the confusion, margin settings in Page SetUp sometimes seem to change for no apparent reason. I can open an application repeatedly over a several-day period and then, suddenly, some of the margins revert back to a default setting. So far, I haven't been able to find out what causes this.

    Appreciate any suggestions on the display size.

    Bill
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Bill, I never use Switchboards, I always build my own "Main Menu" using Command Buttons.
    I will get back to you on the Sizing.
     
  3. Billstan

    Billstan Thread Starter

    Joined:
    Feb 11, 2007
    Messages:
    15
    Thanks for your reply, OBP. Your approach of creating your own Main Menu sounds like a much better way and I'll have to learn how to do that. But right now I want to finish this application ASAP. I've looked at the code which was generated for the present Switchboard and find a module as follows:
    ' Open a report.
    Case conCmdOpenReport
    DoCmd.OpenReport rs![Argument], acPreview
    Can I then insert a new command:
    DoCmd.Maximize
    right after the OpenReport command to force a maximized display? (In another life, I used to understand Basic but that was long and many lost brain cells ago). That would seem to resolve my window size problem. But it might not correct the aberrant behavior when you double-click a switchboard item. I don't see any obvious reason in the Switchboard code to control that.
    Bill
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    That is what I would try first. The other place to try it is in the Report's "On Open" Event Procedure, I have just tried it and it doesn't cause any errors, but as the report was already "maximised" it didn't do anything. ;)

    I will send you a copy of my Blank Main Menu, which has about a dozen buttons, some with code (remmed out) and some without code.
     
  5. Billstan

    Billstan Thread Starter

    Joined:
    Feb 11, 2007
    Messages:
    15
    I have an Access application in which several forms and a number of reports are initiated from a restricted Switchboard. Ideally, I would like the reports to display maximized and the forms to display in windows sized to fit them. Apparently I can do one or the other but not both. Window size for forms can be controlled by using the MoveSize command or by turning off AutoResize and dragging the windows borders to the desired size. In that case, however, the reports are all trunacted to fit in the form-sized window. Report windows can be maximized by inserting a maximize command in the Switchboard code but then the forms are also maximized. I've chosen to maximize everything and let the form windows be larger than needed.

    This still leaves a problem with double-click behavior in the Switchboard. A single click on an action button on the Switchboard produces a report maximized to the full width of the screen and extending as many lines down as will fit. That's fine. However, a double-click of the same button produces a report which has been shrunk so that the entire length fits on the screen, making the text too small to read. I don't know what causes this behavior. There seems to be a provision in the report properties to specify what happens with single and double clicks but these fields are blank. Perhaps someone can tell me how to use them.

    Again my thanks to OBP for his help with these problems.

    Bill (VOBP)
     
  6. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Set a onDoubleClick event for the button as well as an onClick event and make them the same. Then it will always open the same way regardless of how they are clicking.
     
  7. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Bill, Rockn, it sounds as if the Second click of the single click event procedure is being "carried over" in to the Print Preview.
    The action of this is to set the "magnifying glass" zoom setting of the Print Preview.
    Therefore it may not be possible to overcome this as the Single click procedure will always take precedence over the double click procedure.

    Update: I have tried many ways to stop this without success and I cannot find a Docmd.DoMenuItem that turns off the "Zoom".
     
  8. Billstan

    Billstan Thread Starter

    Joined:
    Feb 11, 2007
    Messages:
    15
    Thanks, guys. It seems like making OnDoubleClick the same as OnClick is exactly what I want to do. But, alas, I can't seem to do it. I've gone back to the Properties for each of the Switchboard items. Originally OnClick was set to "=HandleButtonClick(N)" for all items where N is the number of the Switchboard item. HandleButtonClick is a function in the Switchboard code whose primary function seems to be to open a report with an acPreview argument. Back in the item Property, I've set OnDoubleClick to an exact copy of OnClick. But it doesn't seem to have any effect on click behavior. Single click still gives just as much of a report as fits lengthwise; double click shrinks the report until to all fits in the available window.

    Maybe I need to take away the acPreview argument. I'll try that.

    Bill (VOBP)
     
  9. Billstan

    Billstan Thread Starter

    Joined:
    Feb 11, 2007
    Messages:
    15
    OK, as I suppose both of you guys could have told me, deleting the acPreview argument or replacing it with acNormal merely sends the output to the printer instead of the monitor. Forsooth! I don't want to pursue this thing ad nauseum but, if you're suggesting that a double click is really interpreted as a series of single clicks, one of which activates Print Preview while the second tells Preview to Zoom, would it be possible to insert a delay before Preview is activated so that both clicks get there before then? If so, how would I do that?

    Bill (VOBP)
     
  10. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Bill, that is one of the things that I tried and "no luck". I even tried opening and closing another "dummy" report that should receive the second click, but no go.

    When you tested the "Double Click" version did you disable the Single Click version?

    if not see my previous post about precedence.

    How many buttons does your Switchboard have?
    It would ot take long to convert it to one of my "Main Menu Forms" which just use Command Buttons, which definitely have an "On Double Click" event procedure.
     
  11. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/544630

  1. 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.
    Dismiss Notice