PLEASE HELP: Reload a subform with updated columns

S

sam

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
 
M

Marshall Barton

sam said:
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
 
Top