Set all check boxes values on form

  • Thread starter Emanuel Violante
  • Start date
E

Emanuel Violante

Hi everyone,

I have a table with 2 fields: Field1(Text box) and Fied2(Check box) in a form.

What i want is a command button to set all Field2 check box to YES, and a
command button to set all Field2 check box to NO

Could anyone help me please????
--
Thanks,

Sorry if my english isn''t correct, but I''m from Potugal ;)

Emanuel Violante Galeano
 
A

Allen Browne

In the Click event procedure of the command button:

Dim strSql As String
If Me.Dirty Then Me.Dirty = False 'Save first
strSql = "UPDATE [Table1] SET [Field2] = TRUE WHERE [Field2] = FALSE;"
dbEngine(0)(0).Execute strSql, dbFailOnError
Me.Requery

Swap the TRUE and FALSE for the other button.

The Requery will take you back to the first record in the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
E

Emanuel Violante

It worked just fine ;)

Thank you verry much,

Sorry if my english isn''t correct, but I''m from Potugal ;)

Emanuel Violante Galeano


Allen Browne said:
In the Click event procedure of the command button:

Dim strSql As String
If Me.Dirty Then Me.Dirty = False 'Save first
strSql = "UPDATE [Table1] SET [Field2] = TRUE WHERE [Field2] = FALSE;"
dbEngine(0)(0).Execute strSql, dbFailOnError
Me.Requery

Swap the TRUE and FALSE for the other button.

The Requery will take you back to the first record in the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
Hi everyone,

I have a table with 2 fields: Field1(Text box) and Fied2(Check box) in a
form.

What i want is a command button to set all Field2 check box to YES, and a
command button to set all Field2 check box to NO

Could anyone help me please????
--
Thanks,

Sorry if my english isn''t correct, but I''m from Potugal ;)

Emanuel Violante Galeano
 
A

Allen Browne

Your English is fine: no difficulty following you.

And you are very welcome.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
F

francislovenfosse

ne m'envoyer plus rien merci
Allen Browne said:
Your English is fine: no difficulty following you.

And you are very welcome.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
 

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