Can someone help me on this one - I have a database that was set up using the contacts database wizard - One useful feature I'd like to keep is just not working - it did in the begininng - but since adding my own stuff to it its not working anymore! This piece of code falls over at rs.edit - compile error: Method or data member not found. But I did not write this code - it was already there...
Private Sub ckPrintFlag_AfterUpdate()
On Error Resume Next
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSaveRecord
End Sub
Private Sub ckSelect_AfterUpdate()
' If clicked, then select all records
' and change label caption. If false,
' then de-select all records and change
' label caption.
On Error GoTo HandleErr
Dim rs As Recordset
Me.Refresh
Set rs = Me.RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveFirst
Do Until rs.EOF
rs.Edit
rs!PrintFlag = (Me!ckSelect = True)
rs.Update
rs.MoveNext
Loop
End If
Me.Refresh
If Me!ckSelect = True Then
Me!lblSelect.Caption = "Clear all contacts"
Else
Me!lblSelect.Caption = "Select all contacts"
End If
ExitHere:
On Error Resume Next
rs.Close
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_PrintLabelsSub.ckSelect_AfterUpdate"
End Select
Resume ExitHere
End Sub
Any ideas please?
Private Sub ckPrintFlag_AfterUpdate()
On Error Resume Next
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSaveRecord
End Sub
Private Sub ckSelect_AfterUpdate()
' If clicked, then select all records
' and change label caption. If false,
' then de-select all records and change
' label caption.
On Error GoTo HandleErr
Dim rs As Recordset
Me.Refresh
Set rs = Me.RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveFirst
Do Until rs.EOF
rs.Edit
rs!PrintFlag = (Me!ckSelect = True)
rs.Update
rs.MoveNext
Loop
End If
Me.Refresh
If Me!ckSelect = True Then
Me!lblSelect.Caption = "Clear all contacts"
Else
Me!lblSelect.Caption = "Select all contacts"
End If
ExitHere:
On Error Resume Next
rs.Close
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_PrintLabelsSub.ckSelect_AfterUpdate"
End Select
Resume ExitHere
End Sub
Any ideas please?