Question Buttons

austie333

Registered User.
Local time
Tomorrow, 03:29
Joined
Jan 7, 2010
Messages
25
Hi Folks,

Two questions.

1st. I have tried to put buttons into a form header and can't make it work, unless I make the whole thing a click event. Is it possible to use buttons in form headers?

2nd. Can you make TABS act as buttons by clicking on them, and getting them to do something other than open that tab? Perhaps you can get round this by doing some kind of code, like if tab is clicked on then do this. Any ideas about to how make this work?
 
Why do you want to make a tab control work as a button? What arre you trying to do?

What version of Access are you using?
 
I want to navigate between tabbed forms without using obvious buttons if possible, but so it appears as if clicking on a tab opens another series of tabs.
 
Sorry, forgot to mention, I am using Access 2007
 
To my knowledge the Tab click event is practically useless. The click area that gets affected is not the caption area but the body of the tab.

Perform a test yourself and see. Go to the CLICK event of a tab and put a Msbox "I was clicked" message and you will see what area of the tab it fires.
 
Thanks VbaInet,

Yeah, I did do all this before posting and came to the same conclusion, but as I am a newbie I thought I would test the deeper waters of more profounder minds than mine who might know a way around this. I can make it appear as if a button is being clicked when in reality it is really the body of the tab, but the trouble is I want if possible two buttons.
 
You would need to play around the idea of using labels. One label for each tab and maybe one more label that will be used for the z-order appearance. A label will always be underneath a tab control.

Set the Style property of the Tab control to None so the Header caption is hidden.
 
Last edited:
you can have a transparent button

size a button, over the tab as you want it - and make it transparent. Or several - I have seen this done with several buttons, to fill a map of the US

now when your user clicks the "tab", they really click the "transparent button".

Does that idea help you at all.
 
True Dave, transparent buttons would do the job too. The only reason I suggested using labels is because you can set the backcolor property of a label to match the backcolor of your tab. But then again the OP would have the task of getting a quick API for the hand mouse over effect (if needed).

NB: Filling the US map with buttons must have been quite a task ay Dave :O I bet you had wished Access had more shapes and shape grouping (like in word) for the click area to fit even more nicely. ;)
 
That's quite useful David. I can see its potential already. :)
 
Thanks for all the help, it was very much appreciated.

I could not get a transparent button to sit on top of a tab as it always would go behind the tab and could not be clicked.

But what I was able to do was to move the tabs themselves further down on the form and place buttons above the tabs [as they might appear in a header if you could place buttons in a header] - but I did not want to have any tab stops with these buttons and so when I intitally did this as soon as I went back into form view the tabs would go straight back to the top of the form and so any buttons that I put in place disappeared on display. The only answer that I found is to use a button that has to have a tab stop selected - for this purpose I simply created an inactive transparent button that I placed off screen that extended from the area in which the buttons appear at the top of the form [as if it were a header] to below the actual tabs. All this is inelegant but works. Then any buttons and other design features you place above the tabs will still appear once back in form view, and can then be clicked on to navigate.

Hi Dave, thanks for this tip I will look and see what I can make of it.

Thanks again folks, much appreciated.
 
I may have posted too soon. Smiling. I have it working as i wish on one tabbed form, but when i tried to duplicate this on another the buttons are still disappearing. So i have done something different but i have not yet realised what, so i will let you know once i know why it worked the first time.
 
I have learned a valuable lesson. When I created buttons in a header and they did not work, and when I created buttons above the tabs on one form and they did not work, it was simply because of tab controls stops - when a tab stop is activated on any other part of the form as was the case with me, it stopped the buttons from displaying [above the tabs] when I placed them there, It is all about where tab controls are on one's forms and I guess the order in which they are ordered. Smiling.
 
For tab controls you use the CHANGE event and test for the main tab control's value.
 
Ah!! That works Bob. Somehow the Change event used makes sense too.
 
For tab controls you use the CHANGE event and test for the main tab control's value.

Hi Bob,

Could you give me an example of how to do this, or point me in the right direction so that I can learn how to do this? Your help is much appreciated.
 
try this:
Code:
Private Sub TabCtl1_[COLOR=Red][B]Change[/B][/COLOR]()
     MsgBox "tab page: " & TabCtl1.value
End Sub
 

Users who are viewing this thread

Back
Top Bottom