Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable buttons on dirty control

Status
Not open for further replies.

SimonPGreen

IS-IT--Management
Mar 8, 2004
116
GB
Hi all,

Anybody advise on the best method of enabling command buttons when a control on a form is dirty.

Have created a couple of buttons for undo & save but would like this buttons to be enabled only once data in a control on the form has changed.

Not sure what the best event to trap this with.

Regards,

Simon
 
RoyVidar's FAQ may be a good place to start.
faq702-5010

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
How are ya SimonPGreen . . .

The [blue]Dirty Property & Dirty Event[/blue] are tied to the current record (not any control). Dirty indicates tah data ina record has been change/edited. The indicator for this is the [blue]pencil icon you get [/blue] in the [blue]record selector[/blue] when you 1st edit the record. So the logic here should be to enable the buttons whenever a record is edited and disabled otherwise.

In the [blue]OnDirty[/blue] event of the form:
Code:
[blue]   Me!UndoButtonName.Enabled = True
   Me!SaveButtonName.Enabled = True[/blue]
In the [blue]OnCurrent[/blue] event of the form:
Code:
[blue]   Me!UndoButtonName.Enabled = false
   Me!SaveButtonName.Enabled = false[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top