Code for Find Record Command on subforms....possible?

  • Thread starter Thread starter Mary
  • Start date Start date
M

Mary

I have a form that has two subforms
I want to seacrh on what is on the suforms by using the
find record command. However, I can only search on the
main form fields..can anyone tell me why and how I can
fix this? Thank you in advance for your time and help.
Mary
 
You could use the subform's RecordsetClone and its FindFirst or FindNext
methods.

From the main form:

Me.SubformName.Form.RecordsetClone.FindFirst "[FieldInSubform] = " &
SomeValue
Me.SubformName.Form.Recordset.Bookmark =
Me.SubformName.Form.RecordsetClone.Bookmark

where SubformName is the name of the subform control on the main form that
is actually holding the subform object.
 
how does this work fro two subforms? or it doesn't?

-----Original Message-----
You could use the subform's RecordsetClone and its FindFirst or FindNext
methods.

From the main form:

Me.SubformName.Form.RecordsetClone.FindFirst "[FieldInSub form] = " &
SomeValue
Me.SubformName.Form.Recordset.Bookmark =
Me.SubformName.Form.RecordsetClone.Bookmark

where SubformName is the name of the subform control on the main form that
is actually holding the subform object.

--
Ken Snell
<MS ACCESS MVP>

Mary said:
I have a form that has two subforms
I want to seacrh on what is on the suforms by using the
find record command. However, I can only search on the
main form fields..can anyone tell me why and how I can
fix this? Thank you in advance for your time and help.
Mary


.
 
I'm not understanding you.... two subforms? You mean a subform within a
subform?

--
Ken Snell
<MS ACCESS MVP>

mary said:
how does this work fro two subforms? or it doesn't?

-----Original Message-----
You could use the subform's RecordsetClone and its FindFirst or FindNext
methods.

From the main form:

Me.SubformName.Form.RecordsetClone.FindFirst "[FieldInSub form] = " &
SomeValue
Me.SubformName.Form.Recordset.Bookmark =
Me.SubformName.Form.RecordsetClone.Bookmark

where SubformName is the name of the subform control on the main form that
is actually holding the subform object.

--
Ken Snell
<MS ACCESS MVP>

Mary said:
I have a form that has two subforms
I want to seacrh on what is on the suforms by using the
find record command. However, I can only search on the
main form fields..can anyone tell me why and how I can
fix this? Thank you in advance for your time and help.
Mary


.
 
Back
Top