Setting Yes/No value through code.

mbrost

Registered User.
Local time
Today, 15:42
Joined
Jun 27, 2005
Messages
26
This has to be a simple solution for you gurus. I need to reset a CheckBox flag on a form after a business rule is carried out.

I noticed the check box gives the value -1 for Checked, and 0 for Unchecked.

So, when the box is checked, I want to clear it after carrying out a business rule. The code I tried doesn't work, it's as follows:

'Turn off WarehouseFlag after linking to Account
If Me.WarehouseFlag = -1 Then
Me.WarehouseFlag = 0
End If

How do I do this? It must be the fact the values are numbers, and the checkbox isn't a number field??

Thanks in advance!

Mike :cool:
 
Have a look at the attached samples.
 
Last edited:
I really don't see anything more complicated than this statement. Assuming your checkbox is named WarehouseFlag,

WarehouseFlag.Value = 0

If you have actions associated with clicking the checkbox itself (not just providing a flag, but actually performing an operation) then you can also add

Call WarehouseFlag_Click

to your code. But your question only requires you to reset the checkbox, so you probably only need the one line.
 
How can you reset this check box in all records?
:o
 
Can you explain?
How to use query?

thank you
 
Attached is a sample for you.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom