update table with unbound checkbox (1 Viewer)

bbwolff

Registered User.
Local time
Today, 13:53
Joined
Oct 1, 2013
Messages
116
very basic question
how do you update table with unbound checkbox?
I'd like to add basic yes/no, true/false on update.
currently I'm using a workaround like this

Code:
If Me.chkInkt = True Then
        status = "true"
        Else
        status = "false"
    End If

which is ok if there's one of these, but sometimes i have more
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:53
Joined
Feb 19, 2013
Messages
16,619
why not just bind the control to the field?

Also if status is a yes/no field then you should use

Status=True (no quotes)

And in fact you don't need the if clause

Status=chkInkt

is quite sufficient
 

bbwolff

Registered User.
Local time
Today, 13:53
Joined
Oct 1, 2013
Messages
116
like this?

Code:
DoCmd.RunSQL "UPDATE Table  SET aesm = me.chkEsm WHERE ID = " & tID
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:53
Joined
Feb 19, 2013
Messages
16,619
no, like this

DoCmd.RunSQL "UPDATE Table SET aesm = " & me.chkEsm & " WHERE ID = " & tID
 

Users who are viewing this thread

Top Bottom