UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Bring control to front w/VBA    
 
   
doctor9
post Mar 24 2009, 05:05 PM
Post #1

UtterAccess Editor
Posts: 12,332
From: Wisconsin



I'm trying to cascade-stack a series of textbox controls on my form (kind of like cards in solitaire), and their front-to-back order can change from time to time. I tried the .BringToFront action, but I get:
un-time error '438':
Object doesn't support this property or method
When I hit F1 while selecting the action, it referred to Excel objects, not Access. Is there a different action that I'd use for an Access form control?
Basically, I want to loop through the controls, bringing each one to the front as I loop. That way the last textbox in the loop appears on top of the others.
Dennis
Go to the top of the page
 
+
Jack Cowley
post Mar 24 2009, 05:10 PM
Post #2

Retired Moderator
Posts: 37,716
From: The San Francisco Bay Area



Dennis -
How about using the controls Visible property to show the control you want?
Just a thought...
Jack
Go to the top of the page
 
+
trapperalexander
post Mar 24 2009, 05:18 PM
Post #3

UtterAccess VIP
Posts: 2,135
From: Plano, TX



SetFocus will bring a control to the front, maybe loop through your controls in order, setting the focus to each one.
TH
Go to the top of the page
 
+
Bob_L
post Mar 24 2009, 05:47 PM
Post #4

Utterly Banned
Posts: 7,038



Actually, why not just do what Jack said. Make everything else's VISIBLE property NO. That's how I've always done it and it takes no more code than looping through and doing other stuff.
Go to the top of the page
 
+
doctor9
post Mar 25 2009, 08:44 AM
Post #5

UtterAccess Editor
Posts: 12,332
From: Wisconsin



Well, what I'm trying to do is show the entire stack, so making controls invisible would make the stack appear to be a single control. The idea is to have the controls that are underneath still partially visible, like when you select Windows->Arrange->Cascade in Excel.
Dennis
Go to the top of the page
 
+
Bob_L
post Mar 25 2009, 10:25 AM
Post #6

Utterly Banned
Posts: 7,038



Well, good luck in trying but I think that, in order to change the order, you would need to open the form in design view for that (even programmatically). I don't think the bring to front will work unless you are in design view.
Go to the top of the page
 
+
doctor9
post Mar 25 2009, 12:17 PM
Post #7

UtterAccess Editor
Posts: 12,332
From: Wisconsin



Yeah, that seems to be the case. Ah, well. It was mostly a "let's see if we can spice up the interface" sort of idea.
Dennis
Go to the top of the page
 
+
KurtW
post Mar 25 2009, 12:24 PM
Post #8

UtterAccess Guru
Posts: 518
From: N. Colorado



This may be WAY off the mark but what about a frame control with an image of the edges of stacked controls that sits behind whatever control is visible at the time?
On essdece the "stacked edges" visible are just an image with a real stached collection of controls on top of it. This stack of controls is precision placed so their eddges do not in fact show. Then you show only 1 control at a time and it appears to be on top of a stack?
Totally off the cuff here. never tested.
Namaste
Go to the top of the page
 
+
doctor9
post Mar 25 2009, 02:13 PM
Post #9

UtterAccess Editor
Posts: 12,332
From: Wisconsin



Kurt,
Thanks for the suggestion... I was hoping to see a bit of each textbox - again, like when you play solitaire you can see a bit of each card - just enough to let you know what the rest of the card looks like.
If I decide to continue to attack this later on, I may pre-stack some unbound textboxes, and assign the values to them with VBA. Then, if the stack order needs to be changed, I'll reassign the text values rather than try to re-order the textboxes.
Dennis
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 30th August 2014 - 09:22 AM