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

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
 
K

Ken Snell

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.
 
M

mary

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


.
 
K

Ken Snell

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


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top