Full Version: Labels On A Tab Form
UtterAccess Forums > Microsoft® Access > Access Forms
Bob G
In my AC2007 DB i have TAB pages. On a few of the tab pages I have LABELS that when clicked run reports. I used labels as I was also experimenting with mouseover and changing the font bold and color. Works just fine.
I am now trying to be able to dynamicaly capture something about the label clicked so that I can use it for historical tracking. me.activecontrol.name returns the TAB control page and not the label on it. I do not want to hardcode the label name or caption or tag as I have quite a few and want to keep it dynamic as possible.
thoughts ?
Jeff B.
Out of curiosity, why labels and not command buttons?
Bob G
to be honest, it looks cool and with a label you can use the background color and text color. where with a command button you can only use the text color.
Bob G
after looking at the entire picture and what historical tracking would represent, it isn't the label I should be concerned with. It should be the underlying report name and subsequent query. If they arent being used then removing those would be the goal. So, to accomplish what I was trying to do with the label caption I simply use the variable stdocname which I use for all my queries and reports where applicable.
uess i just needed to see the probelm in print in order to better understand myself
Jeff B.
One work-around I've seen and used is to "lay" a text control over the top of a command button. ... or vice versa ...
You can alter the properties of the text control to 'invent' a more flexible command button.
Bob G
I have tried various things and found that to get the visual effect I was looking for. Here is what I have done in a simple example. In my users environment where they get interupted and such it was nice to see the change of color so they knew where they were if there screen froze or they walked away or whatever. I am sure there are better ways to accomplish this but, why break what doesnt need fixing.
HAs the mouse moves over the lable it first clears the forecolor and bold and then changes the forecolor to Red and bolds the font.
Private Sub Label130_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label130.ForeColor = RGB(255, 0, 0)
Label130.FontBold = True
End Sub

The nobold function has every label listed with the value set to false
public function nobold()
label130.fontbold = false
end function

the nocolor function has every lable listed with the value set to "default"
public function nocolor()
label130.forecolor = RGB(0,0,0)
end function
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.