>>Would appreciate someone to point me where I could get information on creating command buttons. I am still a newbie at VFP and doing well copying routines from other projects but now trying to create my own form.
>>
>>I have created a simple form with fields from a table and want to edit existing records and add new records. I have noticed that a sample form I have seen will not allow any field to be modified unless the edit button or add button is pressed. I realize that individual fields have the enable function but how does one get all the fields enabled or disabled based on a command button?
>
>To enable a field, you change its Enabled or ReadOnly property. For instance, in the Click() event of a command button:
>
>
>ThisForm.TxtField1.Enabled = .F.
>
>or
>
>ThisForm.TxtField1.ReadOnly = .T.
>
Also, it isn't necessary to disable fields. If you use buffering, you can save changes with TableUpdate(), and discard changes with TableRevert().
See also:
CursorSetProp("Buffering")
GetFldState()
GetNextModified()
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)