select all checkboxes command

Andromeda31

Registered User.
Local time
Today, 16:37
Joined
Oct 14, 2009
Messages
33
Access 2003 format database in Access 2007, I have a button at the top
of a continuous subform to 'select' or (or deselect) all of a particular checkbox

I am trying to get the code in this post
http://www.access-programmers.co.uk/forums/showthread.php?t=208469

to work.

The recordset bit is working now it is set to: Dim rst As DAO.Recordset

When I run the complete code it crashes with Runtime error '3265' item cannot be found in this collection...

When I click 'debug' the highlighted line is :
If rst![fieldname] Then

Any ideas on how to troubleshoot this further?

Once I define a recordset how can I use debug.print ([fieldname])
to see if it can find the field?

Many thanks
AC
 
Post your code and the table stucture and table name of which table needs modified. Then I can help you.
 
Table 'MCC' with following fields
Autoid Autonumber
CaseNo Number
Details Memo
Print Yes/No

Form CaseContact filtering on CaseNo

Continuous Subform CaseContactSub listing items in MCC
Command Button with code on click event is at top of this subform
CaseNo, Details, Print

Print checkbox field on the form is [Check9]

Code I was using to select every item in the print field is:

Code:
Dim rst As DAO.Recordset, i As Integer

Set rst = Me.RecordsetClone
i = 0
rst.MoveFirst
Do While Not rst.EOF
   i = i + 1
   rst.Edit
   If rst![Check9] Then
       rst![Check9] = False
   Else
       rst![Check9] = True
   End If
   rst.Update
   rst.MoveNext
Loop
MsgBox i & " Records Marked."

rst.Close
Set rst = Nothing

This give you anything to work on?

Thanks
AC
 

Users who are viewing this thread

Back
Top Bottom