M
Mat
Hello
I have a form that has a subform with Child and Master fields linking
the data.
The data source for the subform is a query.
I have a button on the master form that changes the query to show
different data (I.E. all data for a company or a selection of data), as
follows :
************************* On click event for toggle button
If Me.change_btn = 0 Then
strSQL = "SELECT invoices.ID, invoices.company FROM
invoices;"
qdf.SQL = strSQL
Forms!company!invoices_subform.Requery
Else
strSQL = "SELECT invoices.ID, invoices.company FROM invoices
WHERE (((invoices.paid) Is Null));"
qdf.SQL = strSQL
Forms!company!invoices_subform.Requery
End If
*************************
The strSQL updates the query no problem, but the updated query is not
being displayed in the subform untill I close the form and re-open it.
The question is, how do I requery, refresh or rewhatever the subform in
order to show the correct data.
Thanks in advance
Mat
I have a form that has a subform with Child and Master fields linking
the data.
The data source for the subform is a query.
I have a button on the master form that changes the query to show
different data (I.E. all data for a company or a selection of data), as
follows :
************************* On click event for toggle button
If Me.change_btn = 0 Then
strSQL = "SELECT invoices.ID, invoices.company FROM
invoices;"
qdf.SQL = strSQL
Forms!company!invoices_subform.Requery
Else
strSQL = "SELECT invoices.ID, invoices.company FROM invoices
WHERE (((invoices.paid) Is Null));"
qdf.SQL = strSQL
Forms!company!invoices_subform.Requery
End If
*************************
The strSQL updates the query no problem, but the updated query is not
being displayed in the subform untill I close the form and re-open it.
The question is, how do I requery, refresh or rewhatever the subform in
order to show the correct data.
Thanks in advance
Mat