update table with unbound checkbox

bbwolff

Registered User.
Local time
Today, 19:19
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
 
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
 
like this?

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

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

Users who are viewing this thread

Back
Top Bottom