Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access VBA Msgbox - Center on Form, not Window

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
Is there a way to code a MsgBox in VBA to not "Auto-Center", or better yet, tell it where to show up in relation to the form, as apposed to just centering on the whole screen? For instance, at work, some of us have 2 monitors, and when msgboxes pop up, and "auto center", they always are sitting half on one, and half on the other monitor. Any way around this?

Thanks for any info,

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Are you talking about controlling only the message boxes your code launches or a system-wide message hook?

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Hi kjv1611,

Have you thought about using custom popup forms as your message boxes?

Then you code your message form top, height, left etc based on the previous form.

Hope this helps.
 
It's much easier to create your own custom message dialog than it is to move the system messagebox, but if you want to try it, you have to use a callback function. Callbacks can be unstable if they aren't coded properly, and also during debugging. Here's a link to another forum with the same question:

Position a MsgBox

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Thanks for the info... I'll check into it this comming week. Will post back with any decisions, progress.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top