Set all check boxes values on form

  • Thread starter Thread starter Emanuel Violante
  • Start date 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
 
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]...
 
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
 
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]...
 
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
 
Back
Top