Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Checkbox in Datawindow

Checkbox in Datawindow

Checkbox in Datawindow

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"  )

RE: Checkbox in Datawindow

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.


"Nature forges everything on the anvil of time"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close