I'm not to advanced with the Loops in Access coding, so I'd appreciate it if someone would help me with this issue...
I have a recordset that has been retrieved from a query and all of the records are viewed in a Continuous Form so the user can check off (yes/no box) a record if needed. On my Exit button, I want to make it so if the user checked off the record(s), it will clear the checks (reset them to False) before closing the form. I tried the IfDirty - but that effects each individual record everytime a change is made and I don't want the changes to be permanent unless the process has been correctly completed.
I know I need to use a For...Next statement, but I don't know the terminology to assign the record as the element and the group as the recordset. This is what I've tried:
Dim myObject, myCollection
If MsgBox("This will reset any Offsets selected.", vbOKCancel, "Exit?"
= vbCancel Then
Exit Sub
End If
For Each myObject In myCollection
If Me.Offset_CHECK = True Then
Me.Offset_CHECK = False
Me.Offset_DR = Null
Me.Offset_CR = Null
End If
Next
DoCmd.Close
When I try to run it, I get a type mismatch error.
Can anyone help me?
Thanks in advance,
Carie
I have a recordset that has been retrieved from a query and all of the records are viewed in a Continuous Form so the user can check off (yes/no box) a record if needed. On my Exit button, I want to make it so if the user checked off the record(s), it will clear the checks (reset them to False) before closing the form. I tried the IfDirty - but that effects each individual record everytime a change is made and I don't want the changes to be permanent unless the process has been correctly completed.
I know I need to use a For...Next statement, but I don't know the terminology to assign the record as the element and the group as the recordset. This is what I've tried:
Dim myObject, myCollection
If MsgBox("This will reset any Offsets selected.", vbOKCancel, "Exit?"
Exit Sub
End If
For Each myObject In myCollection
If Me.Offset_CHECK = True Then
Me.Offset_CHECK = False
Me.Offset_DR = Null
Me.Offset_CR = Null
End If
Next
DoCmd.Close
When I try to run it, I get a type mismatch error.
Can anyone help me?
Thanks in advance,
Carie