Button to uncheck " Checkbox "

Anonymous
2020-02-19T06:21:01+00:00

Hello

I'm New in VBA and I have a question, I hope someone can help me

I have one Table, one Query, and one Form

Table “PMACustomer” contains all records for all Branches, (separate by Branch No. are like 01, 02, 03….)

By Making Query “PMACustomerQry “able to ask by Branch No. to show just that Branch records.

Form “PMACustomerQryFrm” is an end-user data Form entry.

If you open “PMACustomerQryFrm” form

1- 1st ask you Branch No. (Please Type 01)

2- It has a Red Button on this form (Upper Right)

3- I want when I press on this Button “Uncheck “all Checkbox name “Invoiced”

4- But I want just those checkbox showing in this form with that Branch No. get uncheck not others 

5- If Branch No. change to others still have checkbox clicked (not change other branch checkboxes)

If you open VBA on this Button I did some code but I cannot find the argument/code right for it too.

My Table contains:

PMA_ID         AutoNumber

PMAName      Short Text

PMABranch    Short Text

Invoiced          Yex/No

My Query

SELECT PMACustomer.PMA_ID,PMACustomer.PMAName, PMACustomer.PMABranch, PMACustomer.Invoiced

FROM PMACustomer

WHERE (((PMACustomer.PMABranch) Like [Please Type Your Branch No like 01, 02, 03]));

My Form: 

it has Just all field and Default View Continuous Forms

but I add a Botton in this form for unchecking all " Invoiced " Checkbox for each record.

my problem start when I used this button all record includes records belong to other Branch get uncheck, 

what I want each branch able to uncheck just own checkbox

Private Sub Command17_Click()

CurrentDb.Execute " update PMACustomer Set Invoiced = false"

where ?????????????

Me.Requery 

End Sub 

I know my code has missing where or when an argument

Could someone help me on this code

thank you all

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Anonymous
    2020-02-20T16:06:07+00:00

    Thank you

    I will let you know what I did 

    M.

    0 comments No comments
  2. Anonymous
    2020-03-01T07:42:19+00:00

    Thank you all

    Thank you  Scottgem

    Its work fine

    0 comments No comments