Send to Back Using VBA

  • Thread starter Thread starter Dominic
  • Start date Start date
D

Dominic

Guest
Help! I have a report that I would like to add a control to and then send it behind other controls.
I can create the control OK, but I cannot 'send to back'. Clearly I can do this manually by selecting the control and clicking 'send to back ' from the menu. But how do I do it programmatically.
I can see the RunCommand acSendToBack but when I do this I get a message that the command cannot be run at this time. It is as though Access doesn't know what control I ma referring to?

Any ideas?

Thanks in advance!
 
The thing is that you cannot use send to back when your not in designer mode. So i guess u put your control's visible to false or true.
ED
 
Tx Ed,

I'll keep looking!

P.s. if what you say is true, under what circumstances can I use acSendToBack???
 
The RunCommand instruction is use with all the AcCmd...Something instruction.
Those instruction are the VBA command of all the command u can uses in the macros.

All of this means that you can make macros to help you desgin some forms.
ex: a macro that selects one type of object and send then sends it to the back.

ED
 
If I am understanding what you are saying, I have also done something of the sort, With certain Text boxes, and controls, I have (in design view) placed them one on top of each other and at any given point, when other command buttons are selected, I have just change the visibility statements to either false or true... i.e: Entering Domestic invoices, or enteriing Canadian invoices or entering International invoices, If a certain check box is checked, the text box or combo box is visible corresponding to its regions of the world...I would try using the visibility statement, it seems to work well for me...
 

Users who are viewing this thread

Back
Top Bottom