MsgBox to show in the middle of the form (1 Viewer)

rodin

Registered User.
Local time
Today, 00:39
Joined
Aug 25, 2006
Messages
12
Hi,

I have a Form that is modal and popup, and which opens without the MS Access in the background. It is like a separate window (piece of program) that runs under Windows XP.

If I move the Form on my screens (I have dual monitors) I would like that the messages that are triggered by various actions to appear on top of the form not - for example - on the other screen .

I can add more info if necessary.

Thanks for help.
 

Moniker

VBA Pro
Local time
Today, 02:39
Joined
Dec 21, 2006
Messages
1,567
Just use the Move Method. Straight from Access help:


Moves the specified object to the coordinates specified by the argument values.

expression.Move(Left, Top, Width, Height)
expression Required. An expression that returns one of the objects in the Applies To list.

Left Required Variant. The screen position in twips for the left edge of the object relative to the left edge of the Microsoft Access window.

Top Optional Variant. The screen position in twips for the top edge of the object relative to the top edge of the Microsoft Access window.

Width Optional Variant. The desired width in twips of the object.

Height Optional Variant. The desired height in twips of the object.

Remarks
Only the Left argument is required. However, to specify any other arguments, you must specify all the arguments that precede it. For example, you cannot specify Width without specifying Left and Top. Any trailing arguments that are unspecified remain unchanged.

This method overrides the Moveable property.

If a form or report is modal, it is still positioned relative to the Access window, but the values for Left and Top can be negative.

In Datasheet View or Print Preview, changes made using the Move method are saved if the user explicitly saves the database, but Access does not prompt the user to save such changes.

Example
The following example determines whether or not the first form in the current project can be moved; if it can, the example moves the form.

If Forms(0).Moveable Then
Forms(0).Move _
Left:=0, Top:=0, Width:=400, Height:=300
Else
MsgBox "The form cannot be moved."
End If

~Moniker
 

rodin

Registered User.
Local time
Today, 00:39
Joined
Aug 25, 2006
Messages
12
I can use the Move Method on the FORM, but I need the MSGBOXES (that are triggered by various actions of the user) to show on top of the form if I move the form around the screen.
 

Users who are viewing this thread

Top Bottom