Fix Access Runtime Error 6 When Opening a Form on a Second Monitor
Question details
The user needs to resolve an overflow error when an Access form opens on a second monitor.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A form is opened and positioned toward the far side of a second monitor.
- Observed behavior
- Access displays Runtime Error 6, Overflow. Reported position values differ between working and failing cases, including a negative value in the failing case.
Open the Access database with permission to view and edit its VBA code. Identify the form and the code that positions it, and reproduce the issue with the second monitor connected.
Debug and correct the form position calculation
Use a breakpoint to find which coordinate or calculation causes the overflow before the form moves.
A negative coordinate can be valid on a multi-monitor desktop, so it is not necessarily the error by itself. Check the calculation and the data types used to store its intermediate and final values.
In Access, open the form in Design View, open its property sheet, and use the event property's build button to open the VBA procedure that positions the form. Find the Move statement.
In the VBA editor, click the line before the Move statement and press F9. A highlighted line indicates that execution will pause there.
Open the form on the second monitor. When execution pauses, press Ctrl+G to open the Immediate window and enter expressions such as ? WindowLeft and ? WindowWidth, using the actual variable names from your code. Inspect the calculated left and top values as well.
Press F8 to run the code one line at a time. Check the line that raises the error and the declared types of its operands and result; an Integer is limited to -32,768 through 32,767, and an intermediate calculation can overflow even if the final result would fit.
In the VBA procedure, use an appropriate type such as Long for coordinate variables and convert operands before arithmetic where needed. Validate the calculated position before Move, then reopen the form on each monitor to test it.

Test the form with a different monitor arrangement
Use this workaround to check whether the display layout contributes to the failing position calculation.
Use WPS Office for Compatible Office Documents
WPS Office is a free, lightweight alternative for working with familiar Office documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format compatibility make it easy to move everyday files, though it does not fix Access VBA errors or replace an Access database.

Frequently Asked Questions
What does Runtime Error 6 mean in Access?
It means a numeric value or calculation exceeded the range of the data type being used. In the VBA editor, use a breakpoint and F8 to identify the expression that overflows.
Does a negative form position always cause an overflow?
No. Negative coordinates can be valid in a multi-monitor layout. Inspect the Move arguments, intermediate calculations, and variable types before changing the position.
How do I set a breakpoint in Access VBA?
Open the relevant form event procedure in the VBA editor, click the line where you want execution to pause, and press F9. Open the form again to reach the breakpoint.
Why can a calculation overflow when the displayed values seem small enough?
An intermediate result can exceed the range of its data type before it is assigned to the final variable. Check the types of the operands and convert them before the arithmetic where appropriate.




