bobsmallwood
Programmer
Is there code that could be attached to a pushbutton that would change all True values of a field in a table to blank?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var
qVar query
endvar
;
qVar = Query
;
:myAlias:myTable.db | myField |
| True, changeto Blank |
;
endQuery
;
qVar.executeQBE()
var
tc tCursor
endVar
;
tc.open(":myAlias:myTable.db")
tc.Edit()
;
scan tc:
if tc."myField" = "True"
then tc."myField" = ""
endif
endscan
;
tc.endEdit()
tc.close()
method pushButton(var eventInfo Event)
var
sq SQL
db Database
endVar
db.open()
sq = SQL
update
":work:blanktst.db" t
set
t."Value" = null
where
t."Value" = True
endSQL
if not sq.executeSQL( db ) then
errorShow( "Can't Blank Field",
"Click [>>] for details..." )
endIf
endMethod