If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Can't Hide Form
Try this:
Private privateWidth As Long Private privateHeight As Long Private Sub Form_Activate() 'Show the form DoCmd.MoveSize , , privateWidth, privateHeight End Sub Private Sub Form_Load() privateWidth = Me.Width privateHeight = Me.InsideHeight End Sub Private Sub cmdHide_Click() 'Hide the form DoCmd.MoveSize , , 0, 0 End Sub ------ Alex Dirk Goldgar wrote: Nice idea! That exact method won't work because you've already made the form invisible, so the Movesize is applied to whatever other window then becomes active -- the database window if this was the startup form. But you can use the InsideHeight and InsideWidth properties, like this: If mlngWidth 0 Then Me.InsideHeight = mlngHeight Me.InsideWidth = mlngWidth End If (having captured the dimensions in module-level variables mlngHeight and mlngWidth in the Open event, before resizing to zero). -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) "John Spencer (MVP)" wrote in message ... Well, how about adding one line of code to resize the form in the Form's Timer event that occurs after you've turned the form invisible? Private Sub Form_Timer() Me.Visible = False Me.TimerInterval = 0 'Size the form to its original size whatever that might be DoCmd.MoveSize , , 2880, 1440 End Sub Ken Snell wrote: As a scientist, I just love experimenting and finding new info! Thanks, Dirk. -- Ken Snell MS ACCESS MVP "Dirk Goldgar" wrote in message news:#FUUnNtsCHA.2592@TK2MSFTNGP10... As an additional note on this, I just found an interesting trick. I found that even making the form invisible after a timer interval of 1 millisecond was not enough to keep the form from flashing on the screen ever so briefly. BUT ... if you put this line of code in the form's Open event: DoCmd.MoveSize , , 0, 0 (setting its height and width to 0), and you also set its BorderStyle property to None, then you never see any trace of the form. Granted, it makes it a bit tricky to close the form manually, as you still can't see it if you unhide it, but that's as close as I've come yet to a traceless form. -- Dirk Goldgar, MS Access MVP www.datagnostics.com ---------------SNIP----------------------- |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking up a related record in a related form | Jim Normile | Using Forms | 0 | November 3rd, 2004 04:46 PM |
Cursor Positioning | Colin Hammond | General Discussion | 3 | November 2nd, 2004 09:42 PM |
How do I Hide and Show an Access Form? | ABinBoston | Using Forms | 1 | October 2nd, 2004 05:54 PM |
Edit PivotTable Form | Manuel | Using Forms | 0 | August 24th, 2004 11:29 AM |
copying a form | Jim VanGordon | Using Forms | 3 | July 30th, 2004 03:14 AM |