TC
This works great... only one problem, I have this triggered by "Afterupdate"
of the "Complete" check box. However, the recordset clone does not pick up
the check box update. So I am always one record off on figuring out what the
last item checked off is. Is there a way to ensure that the recordset clone
is current?
This is a task check list. Anytime someone checks off an item, and the
check offs may not be in the order of the actual list, the program reads
through the recordset and finds the last item in the list that is checked as
complete.
My code is below:
Dim LastCompleteTask As String ' Description of the task completed
Me.RecordsetClone.MoveFirst
Do While Me.RecordsetClone.EOF = False
If Me.RecordsetClone.Complete.Value = -1 Then '
LastCompleteTask = Me.RecordsetClone.Task.Value
End If
Me.RecordsetClone.MoveNext
Loop
'Set last complete task value in form
Forms![SCHEDULE]![Child38].Form![LastCompTask] = LastCompleteTask
"TC" wrote:
> Ryan, I'm actually not sure if recordsetclone is read/write, or
> read-only. But it would be very easy to test. Try something like this
> in a command button:
>
> with me.recordsetclone
> .movefirst
> .edit
> ![xxxx] = "!!"
> .update
> end with
> me.requery
>
> That test code assumes that the form does have at least one record.
> Replace xxxx with the name of a text field (in the underlying recordset
> of the form) which is displayed on the form *and* which would accept
> the value of "!!" if that value were entered using normal means. Then
> open the form, view the first record, click the button, & see if that
> field changes to "!!".
>
> HTH,
> TC (MVP Access)
> http://tc2.atspace.com
>
>