Disable click event

chrisguk

Registered User.
Local time
Today, 06:46
Joined
Mar 9, 2011
Messages
148
Hi,

I have labels as my buttons and use the click event to carry out there navigation function.

As with normal buttons you can use the Me.buttonname.Enabled = False to disable it.

But I want to do something similar with my label.

I tried Me.labelname.OnClick = False but its looking for a macro. Obviously I could create a macro to carry out the function but I guess thats a messy way to do it.

Any help?
 
Why are you using labels instead of buttons?
 
Why are you using labels instead of buttons?


The buttons look ugly I thought, wanted to give it a more sleeker look similar to the Northwind 2007 version.

But I have 2000 version and transparent button back is not supported here unless you know different.
 
You can actually make the button transaparant in 2000. You could plae it over a label and code accrodingly.
 
You can actually make the button transaparant in 2000. You could plae it over a label and code accrodingly.


Thanks David I shall have a go at that, as I know buttons are far easier to work with.
 
Hi,

I have labels as my buttons and use the click event to carry out there navigation function.

As with normal buttons you can use the Me.buttonname.Enabled = False to disable it.

But I want to do something similar with my label.

I tried Me.labelname.OnClick = False but its looking for a macro. Obviously I could create a macro to carry out the function but I guess thats a messy way to do it.

Any help?
Sorry, what exactly is it you want to do, be able to disable a specific label via VBA?

Are we talking clicking on one label and the others becoming disabled or something similar?

The code you provided, "Me.labelname.OnClick = False", doesn't make sense so I'm not sure your intention.
 
Sorry, what exactly is it you want to do, be able to disable a specific label via VBA?

Are we talking clicking on one label and the others becoming disabled or something similar?

The code you provided, "Me.labelname.OnClick = False", doesn't make sense so I'm not sure your intention.


Well I have an if statement checking whether a form is active or not. If it is then the button that points to it is disabled or in this case a label with a click command in its place.
 
I would imagine the vast majority, if not all, of the code will be the same anyway. If you are looking for an open form then you likely have a function for that, as it's checking if a label / button should be active I guess it is in the form open / load / current event.

The only possible difference is the .enabled command which I have not tried on a label.

I'd follow David's advice and use a command button and if you still want to adapt it to a label (to match the design of the rest of your database I guess) at least you have the code to use as a starting point for the label.
 

Users who are viewing this thread

Back
Top Bottom