Code:
Object : cmdAdd - Procedure : Click
SELECT * FROM tbl_configuration INTO CURSOR duplic && makes a copy for comparison
SELECT tbl_configuration && returns the focus to this table
APPEND BLANK
*!*INPUTS CS = ControlSource
this.cboCate.CS = " "
this.txtName.CS = " "
this.txtDesc.CS = " "
this.cboCate.value = ""
this.txtName.value = ""
this.txtDesc.value = ""
Object : cmdSave - Procedure : Click
answer = MSGBX("Are u sure",,4+43+256)
IF answer = 6 then
IF *CHECKS IF FIELDS IS EMPTY OR NOT* THEN
MSGBX("Empty")
ELSE
SELECT dupli
LOCATE FOR dupli.cate = this.cboCate.value AND dupli.name = this.txtName.value AND dupli.desc = this.txtDesc.value
IF FOUND() THEN
SELECT tbl_configuration
MSGBX("Duplicate")
GO BOTTOM
ELSE
SELECT tbl_configuration
GO BOTTOM
*SAVE THE RECORD*
TABLEUPDATE(.T.)
ENDIF
ENDIF
**Buffering = 3
**INPUTS ARE CONTROLSOURCED TO A TABLE COLUMN
My problem is after the prompt of MSGBX("Duplicate"); and if the user clicks "CANCEL", the inputs are still saved even w/o TABLE UPDATE. Thou my "cmdCancel" has a TABLEREVERT(), why is that?. My suspect is the ControlSource but i dont know the work around. Ideas?
Thanks
Dexter