>I am looking for a way to set a field (mmTextbox) to readonly under certain conditions. If the record is being added the field can be modified, if it is anything else it should be readonly. My thought was to add code to the Enter event of the mmTextbox.
>
>if it is being added
> this.txtEqp_fleetnum.SetAccessFull()
>else
> this.txtEqp_fleetnum.SetAccessReadOnly()
>
>My question is how to determine if the record is being added, is there a status property for the current row that can be checked? is the original value of the control stored someplace that can be checked (if adding the original field would be blank). The field will have a rule that enforces there to be a value; therefore, it should always have a original value if they are editing the record.
When you add a new record via the business object you can examine the business object's DataRow.RowState property. If it's been added, the value is set to DataRowState.Added.
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com