Code: Select all
if NOT oForm.IsModified() then 'no modifications to record, only works on pre-existing records
iAnswer = 6
else
iAnswer=MsgBox("Wijzigingen opheffen?",51,"gegevens gewijzigd") 'record is modified, ask to cancel changes.
end if
if iAnswer = 6 then 'cancel saving to database
if (oForm.isNew) then 'if in insert-row (new record chosen)
oForm.deleteRow() 'cancelrowupdates only works for pre-existing records, how do I do this?
else 'not in new mode means in edit mode
oForm.cancelRowUpdates() 'cancel changes on pre-existing record works ok
endif
elseif iAnswer = 7 then 'save changes to database
if (oForm.isNew) then oForm.insertRow else oForm.updateRow() 'save to new record or update pre-existing record
else
exit sub ' assume cancel -> don't save changes when in new mode
endif
Code: Select all
if (oForm.isNew) then
bm=oForm.Bookmark
oForm.insertRow()
oForm.absolute(bm)
oForm.deleteRow(bm)
else
oForm.cancelRowUpdates()
endif
Code: Select all
if (oForm.isNew) then
oForm.insertRow()
oForm.deleteRow
else
oForm.cancelRowUpdates()
endif