overflow error on input box

CJ_London

Super Moderator
Staff member
Local time
Today, 18:36
Joined
Feb 19, 2013
Messages
16,968
Unlike the msgbox, the inputbox has X & Y parameters to position the box where you want - in twips from top/left of the screen

This can be useful for being able to open the inputbox close to the current position of the cursor or a standard position such as top left of the screen

However it would appear the X & Y parameters are integer, consequently on larger monitors (wider that 22.5 inches) trying to pass a value greater than 32768 results in an overflow error.

The ms help pages are not much help - they just refer to X & Y as numeric values

The only workaround I can do is create my own inputbox (along the lines of the msgbox example I posted a few weeks ago).

Unless anyone has an alternative suggestion?

Either way - given the anticipated support for wide screen, hopefully allowing for forms to be wider than 22.5 inches, I would hope this would be addressed at that time.
 
I agree. This should be changed. I have users with 34" monitors, but I can't put controls past 22.75 inches because the Access.Control.Left property is an integer.
 
As stated, the x-pos & Y-pos input box parameters are integers.
I will contact the A-team to ask whether this has been taken into account when the large monitor support is implemented.

In the meantime, you can use my UnicodeInputBox to handle the situation.
This specifies the X-pos & Y-pos variables as variant (or you can substitute Long for each)

Either way, it works with values greater than the integer limit of 32767

For example, I just successfully used this code:
UnicodeInputBox "Test input", "Form2", "abc", 51000, 10000

NOTE:
The main purpose of the Unicode version is that it supports languages which use Unicode character sets such as Arabic or Bengali without changing locale and keyboard settings
 
Last edited:
The Access team is planning on changing the InputBox statement coordinate parameters so larger coordinate systems are supported. There is no timeline publicly available.
 
Thanks Colin and Tom!

Just a thought - do we know if they are going to add XY parameters to the msgBox? I suspect not, but worth asking the question
 
I didn't ask whether X/Y co-ordinates would be added. Is there a reason for not wanting them to popup centre screen as they do now?
 
Yes - on multiple screens it can pop up on a different screen so a long journey with the mouse🙂 plus I would like it to appear close to the mouse when called from a continuous form

I have my own msgbox version that does that - plus a bit more.
 
The message box ALWAYS appears in the centre of the screen which contains the Access application window.
This still happens if you have a popup form which you've moved to a different monitor.
Any message box called by that form will still appear on the screen with the Access application window
 
The message box ALWAYS appears in the centre of the screen which contains the Access application window.
I know
This still happens if you have a popup form which you've moved to a different monitor.
Agree, but that is not what I want to happen -a number of my forms are popups, and users move them to different monitors. Any messages I want to appear close to where the user is looking (i.e. the mouse) and not have to a) look for the msgbox on a different monitor, b) then move the mouse to the other monitor to select an option and then c) move it back again so they can continue with whatever it was they were doing.

My question was around providing the same parameter options as the inputbox in respect of XY. It doesn't really matter to me as I have developed a workaround but just wondered if it was something that MS should consider.
 
I realise you would already know what I wrote in post #13 - it was more for the benefit of anyone else reading the thread

Personally I don't think its something MS should consider.
I also create my own customised message forms for various reasons including:
  • positioning
  • use of rich text and customised buttons
  • autoclose after set interval
  • hyperlinks (etc)
Whilst it would be nice if all of that functionality was built in, I think there are many other higher priority tasks the A-team should address.
 

Users who are viewing this thread

Back
Top Bottom