Object definition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to resize and move form windows using VBA, however my object definition is not working and all the actions are being performed on the active window. Can someone help (Code bellow).

Ps using Access 2000.

Public Sub Move()
Dim form1 As Form
Dim Form2 As Form

Set form1 = Forms![complain form1]
Set Form2 = Forms![search form new]

With form1
.MoveSize 0, 0
End With

With Form2
.MoveSize form1.WindowWidth, 0
End With


End Sub

Public Sub InTheWay()
Dim Mast As Form

Set Mast = Forms![Master]

With Mast
.Minimize
End With

End Sub
 
The 'SelectObject' method may be what you're after? It
sets the focus to the form you specify.

DoCmd.SelectObject acForm, "complain form1"
-----Original Message-----
I need to resize and move form windows using VBA, however
my object definition is not working and all the actions
are being performed on the active window. Can someone help
(Code bellow).
Ps using Access 2000.

Public Sub Move()
Dim form1 As Form
Dim Form2 As Form

Set form1 = Forms![complain form1]
Set Form2 = Forms![search form new]

With form1
.MoveSize 0, 0
End With

With Form2
.MoveSize form1.WindowWidth, 0
End With


End Sub

Public Sub InTheWay()
Dim Mast As Form

Set Mast = Forms![Master]

With Mast
.Minimize
End With

End Sub
.
 
Elwin is probably right (I don't have Access here to check). Maybe also, see
what object MoveSize is a method of. From memory, I thought it was a method
of the DoCmd object? If so, I'm surprised that it works at all, from the
Form object.

HTH,
TC


Russell Lucas said:
I need to resize and move form windows using VBA, however my object
definition is not working and all the actions are being performed on the
active window. Can someone help (Code bellow).
Ps using Access 2000.

Public Sub Move()
Dim form1 As Form
Dim Form2 As Form

Set form1 = Forms![complain form1]
Set Form2 = Forms![search form new]

With form1
.MoveSize 0, 0
End With

With Form2
.MoveSize form1.WindowWidth, 0
End With


End Sub

Public Sub InTheWay()
Dim Mast As Form

Set Mast = Forms![Master]

With Mast
.Minimize
End With

End Sub
 
Back
Top