Go Back   Access World Forums > Microsoft Access Discussion > Theory and practice of database design

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-15-2019, 01:48 PM   #1
A17BPG
Newly Registered User
 
Join Date: Mar 2018
Location: Sussex (UK)
Posts: 4
Thanks: 8
Thanked 0 Times in 0 Posts
A17BPG is on a distinguished road
Position Msgbox

Hi

Does anyone know if you can place a msgbox anywhere on a Form other than in the centre. ie placing say on the right or in a top corner.

Thanks in anticipation Brian.

A17BPG is offline   Reply With Quote
Old 09-15-2019, 01:53 PM   #2
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 942
Thanks: 64
Thanked 48 Times in 41 Posts
MickJav will become famous soon enough
Re: Position Msgbox

Dont think so but you could use a form made to look like a message box then move it where you wanted I know isladog posted code for moving a form.

Hope it helps mick
__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

MickJav is offline   Reply With Quote
The Following User Says Thank You to MickJav For This Useful Post:
A17BPG (09-17-2019)
Old 09-15-2019, 06:15 PM   #3
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,367
Thanks: 87
Thanked 1,644 Times in 1,526 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Position Msgbox

The only way to do that is if the message box is NOT modal (which means that other code can run behind it) but it also requires you to find ALL windows (including child windows) to find which one is the message box. If you could run code AND if you could find the child box, you would be able to manipulate is positional properties.

However, that is not something that is easy to do. The whole point of a message box is that it is up front and dead center in order to get your attention and MAKE you do something, choose something. To do otherwise is to defeat its purpose.

I think MickJay's suggestion is better... if the purpose isn't to force someone to decide something, then maybe it shouldn't be a message box.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
A17BPG (09-17-2019)
Old 09-15-2019, 06:40 PM   #4
Micron
AWF VIP
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 935
Thanks: 10
Thanked 191 Times in 181 Posts
Micron has a spectacular aura about Micron has a spectacular aura about
Re: Position Msgbox

I can envision a situation where the message box might cover some vital information that pertains to the message, and if you can't see that information, it may be problematic in dealing with the message. Don't forget that the message box may not be one that results in a simple OK response - it could contain 3 options and the info may need to be seen in order to facilitate a choice.

If that is the case, I'd go with a form as suggested, but make it modal. Seems obvious to me that if a decision needs to be made, there ought not to be any further code execution until the choice is made, so modal ought to function well in a case like this.
EDIT - forgot to say that the MoveSize method used in form opening may be simple enough for positioning such a form.
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
The Following User Says Thank You to Micron For This Useful Post:
A17BPG (09-17-2019)
Old 09-15-2019, 09:21 PM   #5
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,388
Thanks: 112
Thanked 2,849 Times in 2,597 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Position Msgbox

As previously mentioned, you can make your own message form and place it where you like. See the customised message box in my example Attention Seeking app.
I would also make it popup and modal so the user has to respond in order to proceed.
The code to place it where you want has the syntax
Code:
DoCmd.MoveSize Left, top, width, height
with all arguments optional. Values are in twips with 1440 twips = 1 inch (567 tips = 1 cm)

If you want to place the form precisely in relation to another object, see this article on my website Accurately Move Forms and Controls
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by isladogs; 09-15-2019 at 09:49 PM.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
A17BPG (09-17-2019)
Old 09-16-2019, 05:24 AM   #6
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,367
Thanks: 87
Thanked 1,644 Times in 1,526 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Position Msgbox

Let's not forget that you CAN manually drag a modal message box to the side to see things if it is covering up something. You just can't do anything underneath it.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
A17BPG (09-17-2019)
Old 09-16-2019, 06:24 AM   #7
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,426
Thanks: 68
Thanked 2,709 Times in 2,594 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Position Msgbox

I submitted the same (code repository) for the mods approval.
Attached Files
File Type: zip messageBox.zip (134.6 KB, 11 views)


__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
A17BPG (09-17-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changes in ad position Jon Access World News 0 05-22-2013 07:28 AM
Rank / Position shark70 Queries 4 09-14-2004 02:09 AM
Position of msgbox latex88 Reports 2 07-11-2003 05:47 AM
Tab Position maxmangion Forms 1 02-26-2003 02:54 AM
Position a msgbox Liv Manto Forms 1 08-30-2001 12:30 PM




All times are GMT -8. The time now is 07:30 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World