G
Guest
I have two subforms, on a master subform of a form. While viewing one of the
lowest level subforms (continuous form) I use a button to setfocus to a
subform (single form) on the same level. I want to retrieve the record on
the continuous that the button is associated with.
My code so far:
Private Sub btnGetJob_Click()
Forms![frm1 Client].Form![Reservationfrm].Form![Jobfrm].SetFocus
With Forms![frm1 Client].Form![Reservationfrm].Form![Jobfrm]
.RecordsetClone.FindFirst "InvNum = """ & Me!txtInvNum & """"
If .NoMatch Then
MsgBox "Record not found!"
Else
.Bookmark = .RecordsetClone.Bookmark
End If
End With
End Sub
It sets the focus to the other subform, but it fails on the ".Recordset..."
line. Error #438,"Object doesn't support this property or method.
On the continuous form, the control for [InvNum] is named "txtInvNum", as it
is on the single form.
Is this the correct method and, if so, what am I doing wrong?
lowest level subforms (continuous form) I use a button to setfocus to a
subform (single form) on the same level. I want to retrieve the record on
the continuous that the button is associated with.
My code so far:
Private Sub btnGetJob_Click()
Forms![frm1 Client].Form![Reservationfrm].Form![Jobfrm].SetFocus
With Forms![frm1 Client].Form![Reservationfrm].Form![Jobfrm]
.RecordsetClone.FindFirst "InvNum = """ & Me!txtInvNum & """"
If .NoMatch Then
MsgBox "Record not found!"
Else
.Bookmark = .RecordsetClone.Bookmark
End If
End With
End Sub
It sets the focus to the other subform, but it fails on the ".Recordset..."
line. Error #438,"Object doesn't support this property or method.
On the continuous form, the control for [InvNum] is named "txtInvNum", as it
is on the single form.
Is this the correct method and, if so, what am I doing wrong?