Alberts MultiSelect Form Question #2

  • Thread starter Thread starter TeeSee
  • Start date Start date
T

TeeSee

I would like to place a new button at the bottom of Alberts' form,
when clicked it would set all check boxes to True. Since this is a
continuous form and the original code has the check box properties
Enabled set to false and Locked set to true, I'm not too sure how to
go about that.

Any suggestions please.
 
I would like to place a new button at the bottom of Alberts' form,
when clicked it would set all check boxes to True. Since this is a
continuous form and the original code has the check box properties
Enabled set to false and Locked set to true, I'm not too sure how to
go about that.

Any suggestions please.

I think I have to mention a couple more things.
The Control Source of the Check box is "=IsChecked([RecID])" (Not the
quotes) which is a part of
Public Function IsChecked(vID As Variant) As Boolean.

I guess I'm hoping some of you will remember previous discussions on
this form.
 
TeeSee said:
I would like to place a new button at the bottom of Alberts' form,
when clicked it would set all check boxes to True. Since this is a
continuous form and the original code has the check box properties
Enabled set to false and Locked set to true, I'm not too sure how to
go about that.

Any suggestions please.

The code to select all would look like:

Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.movefirst
Set colCheckBox = Nothing
Do While rst.EOF = False
colCheckBox.Add CLng(rst!ContactID), CStr(rst!ContactID)
rst.MoveNext
Loop
Set rst = Nothing
Me.Requery
 
The code to select all would look like:

   Dim rst        As DAO.Recordset
   Set rst = Me.RecordsetClone
   rst.movefirst
   Set colCheckBox = Nothing
   Do While rst.EOF = False
      colCheckBox.Add CLng(rst!ContactID), CStr(rst!ContactID)
      rst.MoveNext
   Loop
   Set rst = Nothing
   Me.Requery

Thanks Albert .... Worked like a charm
Could you please explain or do you have an article you could point me
to as to the pros and cons of using RecordSetClone vs actual recorset.

Thanks again
 
Back
Top