How to get a Lable to open a Form

cawash

Registered User.
Local time
Today, 01:00
Joined
Jun 22, 2002
Messages
13
Is there a line of code that is needed to:

when a user clicks on a lable a form opens.

I'm not good at coding so help will be greatly appreciated!!

cw
 
I may be wrong here but i dont think you can actually do that. the reason being that you want the user to click on the label. This would require the label to have the focus.

if you asign the focus to the label it actually sets the focus to the next control and not the label.

I suggest you either use a command button and set its properties so that it looks like a label.

this way it will be able to get the focus and open the form or carry out an action when a user clicks on it.

you would use the onclick event of the command button and add some code like.
docmd.open acform "name of your form"

check the help for syntax.

hope this helps

ian
 
In the On Click event of the label put in:


Docmd.openform "MyFormNameInHere"

And your form will open.
 
thank you for the replies.
what i was trying to do was change the appearance of the grey cmd button. this is why i decided to try a lable.

what i did instead was to put a pic in the cmd button.

thanks again
 

Users who are viewing this thread

Back
Top Bottom