Search in a SubForm

J

JulietaAna

Hello,

I hope can help me.

I have a main form with txtbox and a command button, with them I want to
make a search of registries in a control that is in a subform of the main
form.

how I solve it?

Thanks!!
 
R

Rick Brandt

JulietaAna said:
Hello,

I hope can help me.

I have a main form with txtbox and a command button, with them I want
to make a search of registries in a control that is in a subform of
the main form.

You need to construct a sub-query as your filter on the main form.

Me.Filter = "PrimaryKeyField IN(SELECT ForeignKeyField FROM SubFormTable WHERE
FieldName = '" & Me.TaxtBoxName & "')"
Me.FilterOn = True
 
A

ALESSANDRO Baraldi

JulietaAna said:
Hello,

I hope can help me.

I have a main form with txtbox and a command button, with them I want to
make a search of registries in a control that is in a subform of the main
form.

how I solve it?

Thanks!!


If you know Recordsets use you can try with FindFirst Metod
of SobForm RecordsetClone, if you Match some use
Recordset Bookmark to switch to the right one in SubForm.Bookmark.

Bye
 
J

JulietaAna

I dont know how I can implement it .... :(



ALESSANDRO Baraldi said:
If you know Recordsets use you can try with FindFirst Metod
of SobForm RecordsetClone, if you Match some use
Recordset Bookmark to switch to the right one in SubForm.Bookmark.

Bye
 
J

JulietaAna

where I must place this sub-query?


Rick Brandt said:
You need to construct a sub-query as your filter on the main form.

Me.Filter = "PrimaryKeyField IN(SELECT ForeignKeyField FROM SubFormTable
WHERE FieldName = '" & Me.TaxtBoxName & "')"
Me.FilterOn = True
 
R

Rick Brandt

JulietaAna said:
where I must place this sub-query?

As my message above states, you run the two lines of code and it creates the
subquery as a filter on the main form.
 
Top