Yes/No

G

Guest

Hello all
I have a little problem that I'm sure someone here could help me with or
give me so advise
I have a created a form with 2 textboxs ,1yes/no checkbox and a command
button.
and this form gets filled from a query which updates the table.

The 2 textboxs on form are disabled and one is fill with this code
Complete is my yes / no checkbox

If Complete.Value = True Then
CompletionDate.Value = Now
Else
CompletionDate.Value = ""
End If
So far so good.
What I would like to do is have a commandbutton
set all yes / no checkboxs on form to false
I have tried this code

Me!Complete.Value = False

Which only Works for the first Complete. There will always be only 5
text | text2 | yes-no | boxes on form. The form will be used just to let
person
who does payroll that all Regions are done.

I have created a lot of Excel Forms and understand most code but
can't get this to work

Thanks for any help
 
G

Guest

Hi Mike,

If you only have a single yes/no checkbox, the code you specify is correct.
I assume you are talking about a continuous form that is displaying a yes/no
checkbox and text boxes for multiple records.

If this is the case, have a bit of SQL behind your command button eg:

docmd.runsql "update TABLENAME set YESNOFIELDNAME = false where CRITERIA"

replacing TABLENAME, YESNOFIELDNAME and CRITERIA with proper names/values.

If there are multiple check boxes on a single form, then the easiest way (if
there is only five of them) is to have a line for each box, eg:
me.chkBox1 = false
me.chkBox2 = false
me.chkBox3 = false
me.chkBox4 = false
me.chkBox5 = false

Hope this helps.

Damian.
 

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

Top