rpw...thank you, I got it. -L
-----Original Message-----
In Design view of the form, right-click the label
then
select Properties. In the Properties window, click the
Event tab. There should be five events listed,
including: On Mouse Down, and On Mouse Up.
Click into the properties field of On Mouse Down and
a
drop-down will become visible - click it. Select [Event
Procedure] then click the elipsis to the right of the
field (....).
That should have opened VBA and you should see
something
like this in the window:
Private Sub Label16_MouseDown(Button As Integer,
Shift
As Integer, X As Single, Y As Single)
End Sub
Click into the space between "Private Sub....."
and "End
Sub" and hit the tab key once then type "me." without the
quotation marks:
me.
If VBA intellisense is turned on, you should see a
list
appear.
Scroll through the list and find the name of the
label,
or type the name of the label.
At the end of the label name, type a dot (just like
at
the end of "me.") and another drop-down should appear.
Scroll through and find "SpecialEffect" (or type the word
without the quotation marks).
Type an equal sign (=) and the number 2.
Your code should now look something like this except
that it should have the name of your label:
Private Sub Label16_MouseDown(Button As Integer,
Shift
As Integer, X As Single, Y As Single)
Me.Label16.SpecialEffect = 2
End Sub
Next, do the same for the On Mouse Up, except the special effect number is 1
Also, to change the color of the "button", go back to
the Properties window of the label and click on the
Format tab. Click the elipsis to the right of the Back
Color property and select from the colors shown. Do the
same for the Fore Color which colors the text.
--
rpw
:
Ken, Sounds great, here's my problem. I am not very
advanced in access and sometimes need to be talked to
like a two year old. So, keeping that in mind, please
tell me, where is the MouseDown and MouseUp events? Thank
you for your help, I really appreciate it.
-----Original Message-----
You can "simulate" a colored button by using a label
(with non-default back
color) with Raised special effect. On its MouseDown
event, change it to
Sunken effect. On its Click event, run code just
as
you
would with OnClick
of a button. On its MouseUp event, change the special
effect back to Raised.
--
Ken Snell
<MS ACCESS MVP>
(e-mail address removed)...
I haven't found a way to change the background color
of a button. The
forecolor (text) property of a command button is
changeable by using a VBA
"If Then" routine.
In order to explain in detail about how to
change
the
color of the text,
we'd need to know some details about your application.
Are you familiar with using VBA?
--
rpw
:
Hello, I'm not sure if this is possible. I have
created
a command button which opens another form. Can I
have
this button change colors when data has been inputed
in
that form? If so, how? Thank you in advance.
.
.