move method

irade92

Registered User.
Local time
Today, 08:46
Joined
Dec 26, 2010
Messages
229
Hi
I want to move control on a form from one place to another...I tried to use this move method:
me.control.move(,,,6000)
but obviously this is not right syntax..please help
Thanks
 
if you mean moving control from one field to another within the same record then use the setfocus method. EG me.formname.nextcontrol.SetFocus
If you mean moving control from one record to another then you can use the move method to change record but the exact coding would depend on which record (next, previous, x records forward/backward etc) you want to move to.
 
I want to move control on a form from one place to another

If you are wanting to move the a control to a different location on your form, you need to use the Left and/or Top properties of the control.

Check the Access Help file for more information about twips and the use of the left or top properties.
 
if you mean moving control from one field to another within the same record then use the setfocus method. EG me.formname.nextcontrol.SetFocus
If you mean moving control from one record to another then you can use the move method to change record but the exact coding would depend on which record (next, previous, x records forward/backward etc) you want to move to.

I mean with docmd.movesize ,,,5000 the form is getting larger and a few new controls are open to place data and I need to move add button a little bit down... The question is how to move Add button a little bit down...
Thnaks
 
If you are wanting to move the a control to a different location on your form, you need to use the Left and/or Top properties of the control.

Check the Access Help file for more information about twips and the use of the left or top properties.

I mean with docmd.movesize ,,,5000 the form is getting larger and a few new controls are open to place data and I need to move add button a little bit down... The question is how to move Add button a little bit down...
I need a little example of the syntax
Thnaks
 
The docmd.movesize command is used to position and/or resize the Window.

If you only need to move a control a little to position it a little down on your form just open the form in design mode and move any control to any location on the form you desire.

From your post I was assuming that at runtime you wanted to reposition one or more controls based on options selected by the user. That would be done using VBA code and modifying the Top and/or Left properties of each control you want to relocate.

Now after you posts, I am not totally sure exactly what you are really trying to do. Hope this helps.
 
The docmd.movesize command is used to position and/or resize the Window.

If you only need to move a control a little to position it a little down on your form just open the form in design mode and move any control to any location on the form you desire.

From your post I was assuming that at runtime you wanted to reposition one or more controls based on options selected by the user. That would be done using VBA code and modifying the Top and/or Left properties of each control you want to relocate.

Now after you posts, I am not totally sure exactly what you are really trying to do. Hope this helps.

Exactly..onOpen form I open form with regular size, after inserting some data in a certain control with AfterUpade event I need to resize the window and additional controls to be visible..This means that the final Add buton to be reposition automatically...(a little bit down) I know that it is possible so I need exact syntax of the code to reposition...How much to go down I dont know becouse I don't know the old position of Add button in tvips.
To be more precise it is a kind of visual effect ..i can do it by opening form in whole dimension and some control to be visible or not but as I said it is a matter of visual effect..
 
Just set the top property (as has been mentioned already). In the After Update event, if you have figured out how many TWIPS you need to add for each line added, you can use:

as an example
Code:
Me.ButtonNameHere.Top = Me.ButtonNameHere.Top + 250
 
To get the current location in twips: with your form in design view, select the Add button control and read the value in the Left and Top properties of the control. Multiply the value displayed for each by 1440. The is the location value in twips.

You can move the Add button to the new location where you want it to be when certain conditions are met and again read the Left and To properties for the control and multiply each value by 1440. This will give you the new position in twips.

To relocate the control use code like the following:
Code:
If SomeCondition = true then
     With Me.NameOfAddButton
          .left = calculated twips for left location
          .top = calculated twips for top locaiton
     End With
Endif

Hope this helps
 
To get the current location in twips: with your form in design view, select the Add button control and read the value in the Left and Top properties of the control. Multiply the value displayed for each by 1440. The is the location value in twips.

You can move the Add button to the new location where you want it to be when certain conditions are met and again read the Left and To properties for the control and multiply each value by 1440. This will give you the new position in twips.

To relocate the control use code like the following:
Code:
If SomeCondition = true then
     With Me.NameOfAddButton
          .left = calculated twips for left location
          .top = calculated twips for top locaiton
     End With
Endif
Well...thanks a lot ..finaly I got what I need....GREAT THANKS
Hope this helps
One more question please

I use this code:
Private Sub mCl_AfterUpdate()
If mCl <> "00" Then
DoCmd.MoveSize , , , 7450
With Me.cmdOk
.Left = 13680 ' (9.5 cm)
.Top = 12240 ' (8.5 cm)
End With


Else
DoCmd.MoveSize , , , 5450
With Me.cmdOk
.Left = 13680
.Top = 10800 ' (7.5 cm)
End With
End If
'And cmdOk control disappeared...cannot see anymore...Do I miss something...


End Sub
 
Just set the top property (as has been mentioned already). In the After Update event, if you have figured out how many TWIPS you need to add for each line added, you can use:

as an example
Code:
Me.ButtonNameHere.Top = Me.ButtonNameHere.Top + 250

Thanks man..You are genius...
 
Sorry, but I did not realize that you are using cm's. There are 567 twips in 1 cm.

You will just need to recalculate.
 
Sorry, but I did not realize that you are using cm's. There are 567 twips in 1 cm.

You will just need to recalculate.

Thanks a lot ..Now it is OK!...Thanks...Thanks..
 

Users who are viewing this thread

Back
Top Bottom