Display table in form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have seen table being displayed in a section of a form. Understand that is
it done by a subform. But to my knowledge, a subform comsist of 2 separate
tables.

What I want is a form with a text box and a section to display the table.
The table is actually a result of a query, and the condition of the query is
found in the text box.

Can somebody pls give me the guidance to do it.

Thank you very much.
 
A subform does not consist of 2 tables. It doesn't even have to have a table
or query, but just like a form, it can have only one query or table as its
record source.
You can do exactly what you want without a whole lot of trouble. The
biggest issue you have is the query in the subform using the main form's text
box as the criteria.

When the form opens, there will be no value in the text box which will make
it evaluate to Null, so the query criteria will no records. That may be
okay. So when you enter a value in the text box, you will have to requery
the subform to get it to display the correct results. Put something like
this in the After Update event of the text box:

Me.MySubForm.Requery

Now, your criteria can go in one of two places - either in the query or in
the Filter property of the sub form as:
Forms!MyMainFormName!MyTextBoxName
 
Hi Klatuu,

Can tell me where is the query and filter property of the subform located?

I only know that in list or combo box, you can enter your query in "row
source". But "row source" is not available in subform control.

Pls advise. Thank you!!!
 
Back
Top