Bringing a button to the Foreground?

LHolden

Registered User.
Local time
Today, 01:32
Joined
Jul 18, 2012
Messages
73
Hi all,

This isn't really a necessity or a priority on my database, it's simply to add some flair. I was simply wondering if there was a way to write some code that would move a button to the foreground by pressing a separate button.
i.e. I hit Button A, and Button B is moved to the foreground.

Thanks for any information/help!
 
i.e. I hit Button A, and Button B is moved to the foreground.

On a given form, you may adjust properties of controls via...

Code:
Me.ControlName.PropertyName = PropertyValue
I do not see a "foreground" property of a button, so was unable to give you a more exact sample.
 
Yeah, I couldn't find a similar property, which is basically why I cam here wondering if one existed. Thanks very much for your response!
 
Are you meaning the "Bring to Front / Send to Back" button on the Arrange tab (A2007)???
 
Essentially, yes. I just was wondering if it was possible to invoke that through code or a macro, i.e. without clicking the button on the ribbon.
 
Try:

DoCmd.RunCommand acCmdBringToFront
 
It seems like that would probably work, except I cant seem to get it to let me put in another buttons name for it. Where would I do that?

Ex:
Private Sub ButtonA_Click()
<code>
DoCmd.RunCommand acCmdBringToFront
End Sub

Where do I put in "ButtonB"?
 
Perhaps the DoCmd needs to know which control needs to have focus. Thinking along the lines of...

Minimize Navigation Pane in A2007
http://www.access-programmers.co.uk/forums/showthread.php?p=1127715&posted=1#post1127713

I also see references that it is possible to set DoCmd's focus with

Code:
DoCmd.SelectObject acTable, “YourTable”, True
So I believe it will be a combination of two DoCmd calls. One to set the focus to the correct control, and the second to bring to front/back.
 

Users who are viewing this thread

Back
Top Bottom