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.
 
Back
Top