Greetings.
I've read a lot about this, but nothing seems to be solving my problem. I have an unbound main frm_reporting with a subform (child_reportin g) whose sourceobject is Query.qry_repor ting_all. There are three text boxes in the header of frm_reporting, all unbound, and a few buttons. Each button has an SQL statement assigned to it. The idea is for the user to enter data into the boxes (date ranges) then click the button of their choice which redefines the qry_reporting_a ll's QueryDef and displays the data they want in the subform frame.
This didn't work:
This sort of worked:
If I change the date ranges, the data changes. But when I decide to click a different button that SELECTs different fields, the fields don't refresh--neither add nor disappear; the data is still updating, just not the fields shown. If I close the form and reopen, the fields are represented properly.
Aside from closing/reopening the form, how do I get the fields displayed to reflect the fields in the querydef??
I've read a lot about this, but nothing seems to be solving my problem. I have an unbound main frm_reporting with a subform (child_reportin g) whose sourceobject is Query.qry_repor ting_all. There are three text boxes in the header of frm_reporting, all unbound, and a few buttons. Each button has an SQL statement assigned to it. The idea is for the user to enter data into the boxes (date ranges) then click the button of their choice which redefines the qry_reporting_a ll's QueryDef and displays the data they want in the subform frame.
This didn't work:
Code:
Set dbo = CurrentDb
Set qdf = dbo.QueryDefs("qry_reporting_all")
qdf.sql = strSQL
Me.[child_reporting].Requery
Code:
Set dbo = CurrentDb
Set qdf = dbo.QueryDefs("qry_reporting_all")
qdf.sql = strSQL
Me.child_reporting.Form.RecordSource = "qry_reporting_all"
Me.[child_reporting].Requery
Aside from closing/reopening the form, how do I get the fields displayed to reflect the fields in the querydef??
Comment