vertical space in VBA

G

Guest

Can any one hint at how to space controls vertically via VBA?
I have a form that shows certain controls depending on who is logged in. I'd
like to be able to, set the appropriate Visible properties to yes, then set
the Top property for the first visible control, then align the visible
controls vertically. I've got the first two bits, but can't get the vertical
alignment bit. There's nothing in Help for the VBA bit.
Thanks
 
L

Larry Daugherty

You asked for a hint so that's what you get:

Each property of each control on a form can be read. The Top and Left
properties, for example, can be read and modified.

For interesting things you might do with forms you could check out
Stephen Lebans/s site. He has lots of downloadable stuff.

HTH
 
S

strive4peace

Arvin said:
Try something like:

DoCmd.RunCommand acCmdVerticalSpacingMakeEqual

Hi Arvin,

VERY cool! Thanks!

I have not used that constant. In attempting to find out more, I saw
this nice list (it is filtered for V there is a menu bar list of
alphabet letters across the top)

Full List of All RunCommand Constants
http://home.clara.net/tkwickenden/list/listv.htm

'~~~~~~~~~~~~~~~~~~~~

and some code here:

http://home.clara.net/tkwickenden/codeex/157to162.htm

"This routine allows you to display a toolbar to assist in the design of
a Form or Report. There are a number of steps required to ensure this
example works.

1. Create a toolbar called "SpacingTools"
2. Add the required buttons to the toolbar.
3. Name the buttons as appropriate. Set the on action property to
"=ControlSpacing("HEqual")" etc.
4. Add the ControlSpacing function to a module
5. Display the Toolbar "SpacingTools" when in the design of a form
or report

'***************** Code Start *******************
'This code was originally written by Terry Wickenden."
' etc

'~~~~~~~~~~~~~~~~~~~~

I think I'll try it!


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top