Double click event on a label? (1 Viewer)

George J

Registered User.
Local time
Today, 03:37
Joined
Dec 4, 2011
Messages
51
I am not sure if this is possible to do, but my dirty workaround would be to have a transparent textbox over the label.

Is this how others would do it, or is there something else I should be looking at?

many thanks
G
 

plog

Banishment Pending
Local time
Yesterday, 21:37
Joined
May 11, 2011
Messages
11,653
I really want to ridicule you, but I'm confused that I maybe I'm missing something--I'm able to put a double click event on Labels. What exact issue are you having doing so?
 

George J

Registered User.
Local time
Today, 03:37
Joined
Dec 4, 2011
Messages
51
Please ridicule away - I was surprised that I couldn't do it too, though I've never tried before.

On the form, I have textboxes and their labels. I want to be able to doubleclick the label (kind of a user prompt but don't want to use controltip) and a message pops up with an example of what to enter into the textbox.

When I select the label however, the Data and Event tabs of the property sheet are blank - totally empty. I tried to detach the label from the textbox to see if that made a difference, but it was still blank.
 

plog

Banishment Pending
Local time
Yesterday, 21:37
Joined
May 11, 2011
Messages
11,653
No ridicule--I thought you posted without trying (find that a lot on this forum). Sounds like you tried and the option wasn't available.

I don't know what to tell you. I am using 2010 and it allows me to add a double click event to a label. Perhaps you can make a button and style it as a label.
 

George J

Registered User.
Local time
Today, 03:37
Joined
Dec 4, 2011
Messages
51
Looks like I can have events with a plain label, but one that is joined to or has been disconnected from a textbox can't.

Surely that can't be right!!
Need to investigate this. Going into pedantic mode now.

Thanks for taking a look at this plog.

EDIT:
Another messy fix, but not quite as bad as my original idea.
Select all labels on the form (not the textboxes) then copy & paste.
Move labels so they partially overlay the originals
Press CTRL and select topmost original label then align to right and top.
Holding CTRL click 3 times the topmost label that you aligned to (deselecting the copy and original before reselecting the copy)
Amend the caption to [press spacebar]
Then delete the space from the caption so all copy labels are now blank - events can now be assigned.

Told you it was messy :)
 
Last edited:

GinaWhipp

AWF VIP
Local time
Yesterday, 22:37
Joined
Jun 21, 2011
Messages
5,899
Labels can be temperamental but as long as they are disconnected from the Text Box you can apply the double-click event I use it all the time.
 

dscarr1962

New member
Local time
Yesterday, 22:37
Joined
Jul 26, 2021
Messages
1
I realize that this is an old post but I just started using Access again after quite a long hiatus. I suspect that the reason that Access labels that are connected to a TextBox is because they already have events associated with them. By default, if you click on a Label associated with a TextBox it automatically selects the contents of that TextBox. I found that simply disconnecting the Label from the TextBox (delete the contents of the Label Name property on the TextBoxes property sheet, Other tab) that the Events then show up on the Label's Events tab.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:37
Joined
Oct 29, 2018
Messages
21,491
I realize that this is an old post but I just started using Access again after quite a long hiatus. I suspect that the reason that Access labels that are connected to a TextBox is because they already have events associated with them. By default, if you click on a Label associated with a TextBox it automatically selects the contents of that TextBox. I found that simply disconnecting the Label from the TextBox (delete the contents of the Label Name property on the TextBoxes property sheet, Other tab) that the Events then show up on the Label's Events tab.
Hi. Welcome to AWF!
 

NoLongerSet

Member
Local time
Yesterday, 22:37
Joined
Jul 13, 2021
Messages
31
The problem with disconnecting labels from their associated text boxes is that you break other functionality. Namely, you can no longer click on the label and have the focus automatically go to the text box.

I think the best solution, in this case, is a transparent command button. I use them pretty regularly. Once you are aware of the feature, you'll find all sorts of uses for it:

 
Last edited by a moderator:

CJ_London

Super Moderator
Staff member
Local time
Today, 03:37
Joined
Feb 19, 2013
Messages
16,629
It really depends on what you want to do as to whether or not a label is associated with a control. Whether it is transparent. Etc
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:37
Joined
Feb 28, 2001
Messages
27,219
This is a functionality I rarely used, but the one time I needed it, I had multiple labels that WERE disassociated from bound controls because I usually have titles and a few other things on my forms. In fact, one of the sneakiest things I ever tried to do involved using a very BIG label as a help area that got filled in by whatever control just did a GotFocus. The controls just filled in the label's .Caption (rather than .Value) - but I could double-click it if needed. (Also, my form titles were double-clickable.) Of course, to use the back door, you had to do certain things in a certain order and there were never any visual cues for it. (The fact that it was a help area was irrelevant to the actual double-click function in this case.)
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:37
Joined
Feb 19, 2002
Messages
43,346
You could use the double click event of the text box and you could change it's format looks like a hyper link.
 

Users who are viewing this thread

Top Bottom