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 kepkuldes.com/images/9e8fa21fb0d69fc7bebcd0e973f14f25.png
www kepkuldes.com/images/869dfc51921e66507aecc67ab6e6aca4.png
www kepkuldes.com/images/a041c52b56c56378b9073b5de6fe0877.png
I tried this one:
Dim strFormToOpen As String
Dim ctlTarget As Access.Control
Dim lngBorderHoriz As Long
Dim lngBorderVert As Long
strFormToOpen = "Form2" 'Form3 megnyitása
Set ctlTarget = Me.txtMyTextBox 'textbox neve
DoCmd.OpenForm strFormToOpen
lngBorderHoriz = (Me.WindowWidth - Me.InsideWidth) / 2
lngBorderVert = (Me.WindowHeight - Me.InsideHeight) / 2
With Forms(strFormToOpen)
.Move _
(Me.WindowLeft - .WindowWidth) + lngBorderHoriz + ctlTarget.Left, _
Me.WindowTop + lngBorderVert + ctlTarget.Top
End With
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 kepkuldes.com/images/9e8fa21fb0d69fc7bebcd0e973f14f25.png
www kepkuldes.com/images/869dfc51921e66507aecc67ab6e6aca4.png
www kepkuldes.com/images/a041c52b56c56378b9073b5de6fe0877.png
I tried this one:
Dim strFormToOpen As String
Dim ctlTarget As Access.Control
Dim lngBorderHoriz As Long
Dim lngBorderVert As Long
strFormToOpen = "Form2" 'Form3 megnyitása
Set ctlTarget = Me.txtMyTextBox 'textbox neve
DoCmd.OpenForm strFormToOpen
lngBorderHoriz = (Me.WindowWidth - Me.InsideWidth) / 2
lngBorderVert = (Me.WindowHeight - Me.InsideHeight) / 2
With Forms(strFormToOpen)
.Move _
(Me.WindowLeft - .WindowWidth) + lngBorderHoriz + ctlTarget.Left, _
Me.WindowTop + lngBorderVert + ctlTarget.Top
End With