Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox in Datawindow

Status
Not open for further replies.

billa1

Programmer
Dec 11, 2011
1
FI
I have a checkbox in the datawindow, It can be checked and unchecked. The default value in the db is 0. When Its checked, the db value is updated to 1 and on uncheck uthe value is updated to 0 again.
However, I want to update the database only if it has value 0. If it is already 1, then I don't want to change it back to 0. So please tell me how can I do that?
Here is the code from my datawindow for the checkbox :
Here is the code for that:

column=(type=decimal(0) update=yes updatewhereclause=yes name=ok dbname="table.ok" values="1/0" )
 
You can check the status of the column for each row in the datawindow prior to updating it (see GetItemStaus / SetItemStatus in PB Help). There you can apply your logic and set the column to NotModified! so a SQL update statement is not generated when the update occurs.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top