L
Lloyd
Hello,
this is my first attempt at using recordsetclone to look at the same field
on a continuous form and update the field. I have looked at other examples
on this forum and put together the below code but I keep getting an "invalid
argument 3001 error" when it reaches the first .FindNext.
With Me!subfrmPersons.Form.RecordsetClone
.Bookmark = Me!subfrmPersons.Form.Bookmark
.FindNext Me!subfrmPersons.Form![DOB]
MsgBox Me!subfrmPersons.Form![DOB] 'for testing only
If Not IsNull(Me!subfrmPersons.Form![DOB]) Then Me!subfrmPersons.Form!
[Age] = DateDiff("yyyy", Me!subfrmPersons.Form![DOB],
[Forms]![frmMainEntry]![DateOccd]) - IIf(Format(Me!subfrmPersons.Form![DOB],
"mmdd") > _
Format([Forms]![frmMainEntry]![DateOccd], "mmdd"), 1, 0)
If .NoMatch Then
.FindFirst Me!subfrmPersons.Form![DOB]
If Not IsNull(Me!subfrmPersons.Form![DOB]) Then Me!subfrmPersons.Form![Age]
= DateDiff("yyyy", Me!subfrmPersons.Form![DOB],
[Forms]![frmMainEntry]![DateOccd]) - IIf(Format(Me!subfrmPersons.Form![DOB],
"mmdd") > _
Format([Forms]![frmMainEntry]![DateOccd], "mmdd"), 1, 0)
End If
If .NoMatch Then
MsgBox "No additional DOB's Found"
Else
Me.Bookmark = .Bookmark
End If
End With
this is my first attempt at using recordsetclone to look at the same field
on a continuous form and update the field. I have looked at other examples
on this forum and put together the below code but I keep getting an "invalid
argument 3001 error" when it reaches the first .FindNext.
With Me!subfrmPersons.Form.RecordsetClone
.Bookmark = Me!subfrmPersons.Form.Bookmark
.FindNext Me!subfrmPersons.Form![DOB]
MsgBox Me!subfrmPersons.Form![DOB] 'for testing only
If Not IsNull(Me!subfrmPersons.Form![DOB]) Then Me!subfrmPersons.Form!
[Age] = DateDiff("yyyy", Me!subfrmPersons.Form![DOB],
[Forms]![frmMainEntry]![DateOccd]) - IIf(Format(Me!subfrmPersons.Form![DOB],
"mmdd") > _
Format([Forms]![frmMainEntry]![DateOccd], "mmdd"), 1, 0)
If .NoMatch Then
.FindFirst Me!subfrmPersons.Form![DOB]
If Not IsNull(Me!subfrmPersons.Form![DOB]) Then Me!subfrmPersons.Form![Age]
= DateDiff("yyyy", Me!subfrmPersons.Form![DOB],
[Forms]![frmMainEntry]![DateOccd]) - IIf(Format(Me!subfrmPersons.Form![DOB],
"mmdd") > _
Format([Forms]![frmMainEntry]![DateOccd], "mmdd"), 1, 0)
End If
If .NoMatch Then
MsgBox "No additional DOB's Found"
Else
Me.Bookmark = .Bookmark
End If
End With