|
|
Center form by VBA
Hello All-
I have a form that acts as a splash screen, gives the title of the
application and a graphic while items load in the background. I am trying to
use the Docmd.MoveSize function to center this form in the application window.
When the application starts, this form will be the only one open for several
seconds so it will be against the gray background of the Access Window.
I thought I could use the following code, but it seems to be trying to center
the database tray.
intScreenHeight = Me.InsideHeight
intScreenWidth = Me.InsideWidth
intScreenHeightHalf = intScreenHeight / 2
intScreenWidthHalf = intScreenWidth / 2
intFormHeight = (2.291 * 1440)
intFormWidth = (5.3326 * 1440)
intFormTop = intScreenHeightHalf - (intFormHeight / 2)
intFormLeft = intScreenWidthHalf - (intFormWidth / 2)
DoCmd.MoveSize intFormLeft, intFormTop, intFormWidth, intFormHeight
Any thoughts would be great.
Thanks
Chris
--
Message posted via http://www.accessmonster.com
|
|
0
|
|
|
|
Reply
|
SurveyorinVA
|
1/9/2008 9:39:11 PM |
|
I thought that if a form had its Auto Center property set to Yes, it would
automatically be centred in the application window.
Jeanette Cunningham
"SurveyorinVA via AccessMonster.com" <u19217@uwe> wrote in message
news:7df8244c888be@uwe...
> Hello All-
>
> I have a form that acts as a splash screen, gives the title of the
> application and a graphic while items load in the background. I am trying
> to
> use the Docmd.MoveSize function to center this form in the application
> window.
> When the application starts, this form will be the only one open for
> several
> seconds so it will be against the gray background of the Access Window.
>
> I thought I could use the following code, but it seems to be trying to
> center
> the database tray.
>
> intScreenHeight = Me.InsideHeight
> intScreenWidth = Me.InsideWidth
>
> intScreenHeightHalf = intScreenHeight / 2
> intScreenWidthHalf = intScreenWidth / 2
>
> intFormHeight = (2.291 * 1440)
> intFormWidth = (5.3326 * 1440)
>
> intFormTop = intScreenHeightHalf - (intFormHeight / 2)
> intFormLeft = intScreenWidthHalf - (intFormWidth / 2)
>
> DoCmd.MoveSize intFormLeft, intFormTop, intFormWidth, intFormHeight
>
>
> Any thoughts would be great.
>
> Thanks
> Chris
>
> --
> Message posted via http://www.accessmonster.com
>
|
|
0
|
|
|
|
Reply
|
Jeanette
|
1/9/2008 9:48:25 PM
|
|
|
1 Replies
1139 Views
(page loaded in 0.018 seconds)
Similiar Articles: Center form by VBA - microsoft.public.access.formsHello All- I have a form that acts as a splash screen, gives the title of the application and a graphic while items load in the background. I am try... Center Access2007 Form in the middle of access Main Window ...Center form by VBA - microsoft.public.access.forms Center Access2007 Form in the middle of access Main Window ... Center form by VBA - microsoft.public.access.forms ... capturing the name of the active form in VBA - microsoft.public ...Center form by VBA - microsoft.public.access.forms capturing the name of the active form in VBA - microsoft.public ... ... VBA ... the **current** active ... Access 2007 Continuous form vba code - microsoft.public.access ...Center form by VBA - microsoft.public.access.forms Access 2007 Continuous form vba code - microsoft.public.access ... Center form by VBA - microsoft.public.access.forms ... How do I write a docmd.MoveSize in Visual Basic in Access ...Center form by VBA - microsoft.public.access.forms I am trying to use the Docmd.MoveSize function ... Names in VBA - microsoft.public.access.forms ... Docmd.Movesize - microsoft.public.accessCenter form by VBA - microsoft.public.access.forms I am trying to use the Docmd.MoveSize function to center this form in the application window. Auto Center with 2 forms - microsoft.public.access.forms ...Center form by VBA - microsoft.public.access.forms I thought that if a form had its Auto Center property set to Yes, it would automatically be centred in the application ... Access splash Screen - microsoft.public.access.formscoding ...Center form by VBA - microsoft.public.access.forms Hello All- I have a form that acts as a splash screen, gives the title of the application and a graphic while items load ... Dbl Click to open another form to a specific record - microsoft ...I am a novice so please help me understand as well as help me figure out the VBA ... and only add in the additional fields of phone, fax, & email from the service_center form. Form Name as Variable - microsoft.public.access.modulesdaovba ...Declaring SQL variables from a VBA form list - microsoft.public ... Community Center Forums > Visual Basic for Applications ... Access VBA - using variable as form name ... ... ... FreeVBCode code snippet: Center a form on the screen.This is the snippet Center a form on the screen. on FreeVBCode. The FreeVBCode site ... Office/VBA; Registry; Screen / Graphics; String Manipulation; System API; VB.NET / ASP.NET How can I center a form in monitor screen by VBA codes? - Yahoo ...Best Answer: In the Form_Load event use the following: DoCmd.MoveSize(Right, Down, Width, Height) example (for a small form): DoCmd.MoveSize 3700, 1500 ... Centering a Form using VBA: vba, form, access, centerHi all, I'm using Access 2007 and I'm attempting to address an issue with a continuous form seemingly taking whatever height it feels like when I open it ... Center form by VBA - microsoft.public.access.forms | Google GroupsHello All- I have a form that acts as a splash screen, gives the title of the application and a graphic while items load in the background. I am trying to center a form on display - Microsoft Access / VBAcenter a form on display. Microsoft Access / VBA Forums on Bytes. 7/28/2012 7:50:50 AM
|
|
|
|
|
|
|
|
|