chek Yes/No (1 Viewer)

bhelmy

Registered User.
Local time
Today, 04:52
Joined
Dec 6, 2015
Messages
62
I have a "continuous" subform which is linked to a table which has a checkbox field. I would like to create a Check All/Uncheck All in form
 

Attachments

  • Test.mdb
    428 KB · Views: 47
Last edited:

marlan

Registered User.
Local time
Today, 04:52
Joined
Jan 19, 2010
Messages
409
Code:
Private Sub Check11_AfterUpdate()
    CurrentDb.Execute "UPDATE Table1 SET ff = " & Nz(Me.Check11, False)
    Me.Requery
End Sub
 

Attachments

  • Test.zip
    38 KB · Views: 54
Last edited:

bhelmy

Registered User.
Local time
Today, 04:52
Joined
Dec 6, 2015
Messages
62
when to do that in my DB have error
Run time error 3144
syntax error in Update Statement
 

marlan

Registered User.
Local time
Today, 04:52
Joined
Jan 19, 2010
Messages
409
First: please note I edited the above post.

These two lines of code go in the checkbox AfterUpdate event handler
 

moke123

AWF VIP
Local time
Yesterday, 21:52
Joined
Jan 11, 2013
Messages
3,921
personally i prefer to have it set up to either select all or deselect all just in case they select all in error. I usually use a command button with a caption that changes. heres your db with both a button and a checkbox code.
 
Last edited:

Users who are viewing this thread

Top Bottom