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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with dataset.enablecontrols

Status
Not open for further replies.

garwain

Programmer
Jan 30, 2002
461
CA
I have a program that uses a dbgrid to display a list of records, and the doubleclick event opens another form to edit the data. If certain conditions exists I call the line

dsItem.DataSet.DisableControls;

to prevent editing the record. Then in the formclose event I call;
if dsItem.DataSet.ControlsDisabled then
dsItem.DataSet.EnableControls;
if dsItem.DataSet.ControlsDisabled then
dsItem.DataSet.EnableControls;

when I trace through the execution the second enableControls is called. Any idea where the problem is?
 
never mind. I just realized the disablecontrols was in the dataset's onchange event, so when I tried to enable the controls it would just disable them again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top