Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find a record in form or a subform

Status
Not open for further replies.

Ciro

Programmer
Apr 10, 2002
4
IT
I Use Access97 and this is the HELP I need.
How can I do a find a record in the main form and if not present in the connected subform. I have already made the VBA sub using
.....
Set rstMaschera=Forms![frmShowCase2002].RecordsetClone
....
strTrovami = Me.txtCognome.Value
strCriterio = "Cognome Like '*" & strTrovami & "*'"
....
rstMaschera.MoveFirst
rstMaschera.FindFirst strCriterio
....
if I have a
....
rstMaschera.NoMatch
...
I want to search in the displayed subform called frmAggregati the same strCriterio
I tried repeating the code changing frmShowCase2002 with frmAggregati but it does not work!!
Thanks in advance Ciro
 
Ciro

You need to reference frmAggregati as a subform or control of frmShowCase2002. There are a number of different ways.

Me.Child.Form.RecordsetClone
Forms!frmShowCase2002!Child.RecordsetClone
Forms!frmShowCase2002!frmAggregati.RecordsetClone

See Access Help for additional assistance with the syntax in refering to subforms.

Ciao, Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top