From: sam on
Hi All,

How can I reload a subform to display new results? I have developed a search
form in headersection and inserted a subform in the details section that
displays the results. The problem here is that, the data is refreshed BUT I
have a dynamic SQL statement for columns, where columns are search criterias.
So basically I only want to display columns in the subform that the users
have selected as their criteria.

Thanks in advance


From: Marshall Barton on
sam wrote:
>How can I reload a subform to display new results? I have developed a search
>form in headersection and inserted a subform in the details section that
>displays the results. The problem here is that, the data is refreshed BUT I
>have a dynamic SQL statement for columns, where columns are search criterias.
>So basically I only want to display columns in the subform that the users
>have selected as their criteria.
>

If you change the list of fields in the subform's record
source Select clause, then you need to change the subform
control's ControlSource property accordingly:

With Me.subformcontrol.Form
.ReeordSource = "SELECT f1, f2, f3 ..."
.text1.ControlSource = "f1"
.text2.ControlSource = "f2"
.text3.ControlSource = "f3"
End With

--
Marsh
MVP [MS Access]