Link to home
Start Free TrialLog in
Avatar of urjudo
urjudoFlag for United States of America

asked on

Code for check box in Delete button on a Windows Form in VB.net

Hi Experts,
I have a question about the code for check box in VB.net visual Studio.
I have a Delete button in a windows form, I would lie to do is when users click  the Delete button, it will automatically set the record to true in the SQL server instead remove the delete in SQL server.  I have the field name RecDelete in the SQL table.  I also placed this RecDelete field as a label on the form, but having trouble to figure it out the code.  I tried Me.recdeletelbl.text = true in the Delete Button, but it doesn't work.  and I tried me.recdelete.checked = true, it doesn't work either.  any help would be appreciated.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of urjudo

ASKER

@Ark,
Thank you.
Actually, you don't need button - just checking/unchecking checkbox will switch true/false RecDelete field
Avatar of urjudo

ASKER

@Ark,
Yes, both are works but I already have a button named "Delete", so I just place the code in the Delete button for users to click.
Thanks.
In that case you may want make checkbox.enabled=false
Regards
Avatar of urjudo

ASKER

@Ark,
Yes, thanks for your reminding, in fact, I will not add the checkbox on the form. just leave on the table