Sorry - didn't understand your comments in the previous reply
If you look at the example in the link I supplied in post #2 you will see exactly what I mean about negative values being possible for top & left of a form
e.g. open Form1, drag into top left of app window so its slightly hidden by nav pane and/or ribbon.
Then click Form Info to view the properties of Form1 as shown below:
Anyway, I think what you are trying to do is unlikely to succeed
Coming back to your initial question, there are two built in database properties that are relevant here:
NavPane Closed = 0 when expanded ; 1 when minimized
NavPane Width = integer value such as 315 = saved value for nav pane width when db opened
You can see both of these (and more) by selecting Database Documenter in Tools menu.
Then select Properties in Current Database tab
Alternatively, the function below will get the value for the 'NavPane Width' property
Code:
Function GetNavPaneWidth() As Integer
On Error GoTo Err_Handler
Dim db As DAO.Database
Dim prp As DAO.Property
Set db = CurrentDb()
For Each prp In db.Properties
If prp.Name = "NavPane Width" Then GetNavPaneWidth = prp.Value
Next
Debug.Print GetNavPaneWidth
Set db = Nothing
Exit_Handler:
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & " in GetNavPaneWidth procedure : " & Err.description, vbCritical, "Program error"
Resume Exit_Handler
End Function
NOTE:
1. The width value shown is not affected by minimising / maximising the nav pane
2. If you change the width manually, the property value is not updated until you next open the application
For that reason,I doubt its possible to achieve what you want using VBA