I want to move control on a form from one place to another
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.
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.
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.
Me.ButtonNameHere.Top = Me.ButtonNameHere.Top + 250
If SomeCondition = true then
With Me.NameOfAddButton
.left = calculated twips for left location
.top = calculated twips for top locaiton
End With
Endif
One more question pleaseTo 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:
Well...thanks a lot ..finaly I got what I need....GREAT THANKSCode: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
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
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.