Chaneg a yes/no field through VB code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Guys,

I have a form which is used to update a record. What I would like to happen
is once the user makes their updates and clicks the button a yes / no field
in the table is ticked.

How is the best way to do this?

Do I have to use an SQL update statement (if so can someone please help with
that) or is there a database function I can use to obtain the same result?

Cheers,
Andrew
 
"FollanA" skrev:
Hi Guys,

I have a form which is used to update a record. What I would like to happen
is once the user makes their updates and clicks the button a yes / no field
in the table is ticked.

How is the best way to do this?

Do I have to use an SQL update statement (if so can someone please help with
that) or is there a database function I can use to obtain the same result?

Okay - not entirely sure what you want to do - so I'll give a couple of
examples:

Say you want to have the checkbox to just be ticked (no matter if it was
already ticked) - put the following code on the command button's click event:

me.<checkbox-name> = True

Say you want to have it ticked only if another checkbox is ticked:

if me.<checkbox-name1> = True then
me.<checkbox-name2> = True
end if

Let me know if that helped.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

YES/NO values - HELP! 1
Assign yes/no field 2
Updating a yes/no box 2
Access how do you set a yes/no data type as required? 0
Access Microsoft Access Calculated Field - Expiry Date 0
Boolean property - "Yes/No" 5
Yes/No Field 2
yes/no field display 13

Back
Top