Search in a SubForm

  • Thread starter Thread starter JulietaAna
  • Start date Start date
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!!
 
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
 
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
 
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
 
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
 
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.
 

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

Back
Top