cmdButton

tjones

Registered User.
Local time
Today, 09:28
Joined
Jan 17, 2012
Messages
199
I am wondering if it is possible to make a cmdButton change color.

I have the parent form [StudentInformation] with several command buttons to open the child records.

I would like to be able to make a command button [AddlAddr] change color (say to green) when you enter a record on the AdditionalAddress form (table) so that you know there are additional address records associated with the parent record.

I have seen this in other databases I have used and was wondering if it is possible in Access 2010
 
You can't change the actual command button. You can change its font color, or you can create a picture and then place the command button over it and set its TRANSPARENT property to YES so you can't see it but it will still register the click.
 
So how would you go about making the font color change on the parent record cmdbutton if you enter a record on the child form?

I have been working with the AddlAddress on Dirty with
If Me.Form.Dirty Then
Me.Form![StudentInformation]![cmdAddlAddr] = "Accent 2, Lighter 40%"
End If

But so far not getting it to work.

Thanks to all the help on this site, I have almost finished building this into an excellent database even though it is the very first time I have done any programming or using access.
 
In VBA you need to use the color number, not the type which shows up when you use the selector. And, to refer to the parent from code on the subform you use

Me.Parent.cmdAddlAddr.ForeColor = 12632256 ' which is a gray

or like

Me.Parent.cmdAddlAddr.ForeColor = vbRed
 
OK I get that, but where would you put it on the child record? AfterUpdate, OnDirty, etc.
 

Users who are viewing this thread

Back
Top Bottom