Marshall Brooks
Member
- Local time
- Yesterday, 22:18
- Joined
- Feb 28, 2023
- Messages
- 696
This will be more of a question for @isladogs and I have a workaround, so I'm not terribly concerned about that.
The goal is to have my progress bars displayed in the center of the screen on whichever monitor Access is currently using. (And ideally, it needs to work if Access is opened on one monitor and then moved to a different screen.
The code that I have works for my userforms at any setting.
It works for frmTimerProgressBar in the following situations:
As a workaround, I changed the AutoCenter property of the form to Yes and added On Error Resume Next before that line and On Error GoTo 0 after it. With that change, it displays on the right-side (secondary) monitor, in the center horizontally, but about 1/3 of the way down the screen.
I saw
and
But I couldn't get either one to work.
I think have tblMonitors from the AFR database (but I'm not using AFR with this form), and I think it SHOULD work with making MoveWindow Public and:
But it either doesn't work or gives me an error message on the "With" Statement when I call the form.
The goal is to have my progress bars displayed in the center of the screen on whichever monitor Access is currently using. (And ideally, it needs to work if Access is opened on one monitor and then moved to a different screen.
The code that I have works for my userforms at any setting.
It works for frmTimerProgressBar in the following situations:
- Single Screen
- Dual Screens, Primary on Left, Access on Primary.
- Dual Screens, Primary on Right, Access on Primary.
- Dual Screens, Primary on Right, Access on Secondary.
Code:
DoCmd.MoveSize sngLeft, sngTop
As a workaround, I changed the AutoCenter property of the form to Yes and added On Error Resume Next before that line and On Error GoTo 0 after it. With that change, it displays on the right-side (secondary) monitor, in the center horizontally, but about 1/3 of the way down the screen.
I saw
Form open from another Form
Hello my freinds, I have a problem, what i cant fix.I have 2 monitor, when i try to open a form from a form on my second monitor it has a runtime error 6 overflow if i try to open on my secondary monitors's farest half. Its only work on 2/3 of my monitors. Sorry for bad english :( www...
www.access-programmers.co.uk
".MoveSize" or ".Move" for a popup form positioning
I created an on click button event, which is supposed to move my popup form to the top left corner of the screen. The function that I used was: Private Sub Command1_Click() DoCmd.MoveSize(0 ,0)...
stackoverflow.com
But I couldn't get either one to work.
I think have tblMonitors from the AFR database (but I'm not using AFR with this form), and I think it SHOULD work with making MoveWindow Public and:
Code:
Form_Load()
Dim myrect as RECT
'Move the window to the top right, keep width and height equal to the current values
CheckMonitorInfo
MoveWindow Me.hWnd, 0, 0, myrect.right - myrect.left, myrect.bottom - myrect.top, True ' Top, Left, Width, Height, Repaint
' Get Left and top from DLookup of current Monitors in tblMonitors, adjust above statement
End Sub
But it either doesn't work or gives me an error message on the "With" Statement when I call the form.