Help with a yes/no checkbox (1 Viewer)

Viv_sunville

New member
Local time
Today, 12:53
Joined
Sep 24, 2023
Messages
4
I am a novice in programming.
I have created a form that shows data from a query.
Now I want to add a yes/no checkbox that updates a field in my table.
I found out that I have to do that with a selection box, with an event procedure (after update) but I don't know anything about code.
So in tlb_orders I need to update the Paid field when I check the checkbox.
Who can help me?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:53
Joined
Oct 29, 2018
Messages
21,473
Hi. Welcome to AWF!

Is the Paid field a Yes/No field? If so, why not just add it to the query and the form?
 

Viv_sunville

New member
Local time
Today, 12:53
Joined
Sep 24, 2023
Messages
4
yes the paid field is a yes/no field

I created a checkbox in the form, but I don't know how to make it update a table
Schermafbeelding 2023-09-24 155131.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:53
Joined
Oct 29, 2018
Messages
21,473
Did you also add the Paid field to the query?
 

GaP42

Active member
Local time
Today, 20:53
Joined
Apr 27, 2020
Messages
338
So if you click on your check box in the form, and then look at your table, do you see the Paid field is checked?
The Paid field does not require any special code to update its value from the form - just like the other fields accept entries on the form, unless you have some other checks you wish to do.
The Paid field should be an item on your Invoice/PurchaseOrder table, not on your OrderItem table.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:53
Joined
Oct 29, 2018
Messages
21,473
yes, I did, my query names "prijs"
In that case, all you should have to do is set the Control Source of the Checkbox to Paid. Go to the Control Source property of the Checkbox and select Paid from the dropdown.
 

Users who are viewing this thread

Top Bottom