format of controls for saved records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to make the background color of controls for already
saved/existing records grey and the background of new/unsaved records white.
I want to do this so it will be obvious to those entering data whether they
are entering data for a new record or editing data in an existing record
(which, if unintended would foul up the data). Thanks.
 
Is there a way to make the background color of controls for already
saved/existing records grey and the background of new/unsaved records white.
I want to do this so it will be obvious to those entering data whether they
are entering data for a new record or editing data in an existing record
(which, if unintended would foul up the data). Thanks.

Hmmm...

You could use the Form's Current event to set the backcolor of
controls:

Private Sub Form_Current()
If Me.NewRecord Then
Me!txtThis.BackColor = vbWhite
Me!txtThat.BackColor = vbWhite
Else
Me!txtThis.BackColor = vbGrey
<etc>

John W. Vinson[MVP]
 
That works perfectly. Thanks.

John Vinson said:
Hmmm...

You could use the Form's Current event to set the backcolor of
controls:

Private Sub Form_Current()
If Me.NewRecord Then
Me!txtThis.BackColor = vbWhite
Me!txtThat.BackColor = vbWhite
Else
Me!txtThis.BackColor = vbGrey
<etc>

John W. Vinson[MVP]
 
Back
Top