R
Repent
I have a form that uses the tab control.
The tab control has 5 tabs/pages.
on the form's "on dirty" event i have code that changes the form to a
red color and plugs some warning text into a label control on the
bottom of the 1st page of the tab control. the warning states to the
user that they have changed a record and if they proceed the record
will be changed and saved. They can hit Esc to cancel the changes and
the warning box and red color go away.
I would like to have this same feature on all tabs because the user
can change the record anywhere on any tab.
I copied/pasted the label box from the first page of the tab control
to the other pages of the tab control. When I make a change to the
other tabs, other than the first tab, the box does change to red but
the text is not displayed. This tells me at least that the first part
of the code is running but the rest is not.
Here is the code I have so far:
Private Sub Form_Dirty(Cancel As Integer)
If Not Me.NewRecord Then
Me.Detail.BackColor = RGB(255, 100, 100)
Me.InfoMessage.Caption = "You have modified this record. " & _
"If you move to another record, your changes will be applied. " & _
"To cancel your changes, hit the Esc key (top left of keyboard)."
End If
End Sub
How do I modify the code to get the event to fire for any tab page
where the record is being changed?
thanks all;
chris
The tab control has 5 tabs/pages.
on the form's "on dirty" event i have code that changes the form to a
red color and plugs some warning text into a label control on the
bottom of the 1st page of the tab control. the warning states to the
user that they have changed a record and if they proceed the record
will be changed and saved. They can hit Esc to cancel the changes and
the warning box and red color go away.
I would like to have this same feature on all tabs because the user
can change the record anywhere on any tab.
I copied/pasted the label box from the first page of the tab control
to the other pages of the tab control. When I make a change to the
other tabs, other than the first tab, the box does change to red but
the text is not displayed. This tells me at least that the first part
of the code is running but the rest is not.
Here is the code I have so far:
Private Sub Form_Dirty(Cancel As Integer)
If Not Me.NewRecord Then
Me.Detail.BackColor = RGB(255, 100, 100)
Me.InfoMessage.Caption = "You have modified this record. " & _
"If you move to another record, your changes will be applied. " & _
"To cancel your changes, hit the Esc key (top left of keyboard)."
End If
End Sub
How do I modify the code to get the event to fire for any tab page
where the record is being changed?
thanks all;
chris