Others

Fix Access Runtime Error 6 When Opening a Form on a Second Monitor

Nimra MalikNimra Malik Nov 20, 2026 868 views

Question details

The user needs to resolve an overflow error when an Access form opens on a second monitor.

Fix Access Runtime Error 6 When Opening a Form 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.
Before you start

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.

Solution 1Recommended

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.

1
Open the form code

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.

2
Set a breakpoint

In the VBA editor, click the line before the Move statement and press F9. A highlighted line indicates that execution will pause there.

3
Inspect the values

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.

4
Find the overflowing expression

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.

5
Correct and test the calculation

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.

Debug and correct the form position calculation
Check the monitor layout: Do not automatically reject every negative coordinate: a monitor positioned to the left or above the primary display can use negative desktop coordinates. If needed, temporarily position the form on the primary monitor to isolate the calculation.
Free Microsoft Office alternative

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.

Work with Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday Office tasksOpen and edit documents with a free, lightweight office suiteKeep working on Office files while troubleshooting the Access form separately
microsoft office alternative - wps office

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.