General information
Category:
Forms & Form designer
Title:
Logic for an Add Button
As a FP2.6 DOS programmer converting to VFP6.0 still struggling with understanding the code found in \wizards\wizstyle.vcx. So far I have been able to create the top, bottom, next, edit and delete buttons. Now need to code the add and Find button logic.
Not able to figure out how to blank out the fields on the form. I assume on the click code that part of the code could look like this:
IF THIS.Caption = 'Add'
THIS.Caption = 'Save'
THISFORM.cmdNext1.enabled = .F.
THISFORM.cmdPrev1.enabled = .F.
THISFORM.cmdTop1.enabled = .F.
THISFORM.cmdBottom1.enabled = .F.
THISFORM.cmdedit1.enabled = .F.
THISFORM.cmddelete1.enabled = .F.
THISFORM.allowedits = .T.
THISFORM.REFRESH()
ELSE
IF MESSAGEBOX('OK To Save',4+32+256)= 7
=TableRevert()
ELSE
=TableUpdate()
ENDIF
THIS.Caption = 'Add'
THISFORM.cmdNext1.enabled = .T.
THISFORM.cmdPrev1.enabled = .T.
THISFORM.cmdTop1.enabled = .T.
THISFORM.cmdBottom1.enabled = .T.
THISFORM.cmdEdit1.enabled = .T.
THISFORM.cmdDelete1.enabled = .T.
THISFORM.allowedits = .F.
THISFORM.REFRESH()
ENDIF
Could someone help me fill in the blanks? Also would appreciate a tip on how to code a Find Button.
Thanks in advance for any assistance.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only