Colors

Lourry

Registered User.
Local time
Today, 02:42
Joined
May 19, 2004
Messages
41
Hello All,

When I am in the "design view", I set the Back Color property of my form to green, but I want the form to change to red when the user clicks on the "Insert New Record" button on the navigation bar. And once the user saves the record, it will change back to green. How do I achieve this?

Thanks a lot!

-Lory
 
G’day Lory

If I understand correctly then this should work: -


Code:
Private Sub Form_Current()

    If Me.NewRecord Then
        Me.Detail.BackColor = vbRed
    Else
        Me.Detail.BackColor = vbGreen
    End If
    
End Sub
Hope that helps.

Regards,
Chris.
 
On the onclick event of the new record button you can put in the code the following:

Me.Detail(or any other part of the form).BackColor = 255 '255 is red

Then do the same to change it again onclick of the save button.
 

Users who are viewing this thread

Back
Top Bottom