I create a SQL string (called str) and use it to create a query for the recordsource on a subform. The reason I do this is because the SQL string was too long.
It works, but I can get the form to refresh to show the new data. Below is what I'm doing. Any ideas?
Thanks.
Set qdf = db.CreateQueryDef("qryRecordsource", str)
[frmSub].Form.RecordSource = ""
[frmSub].Form.RecordSource = qryRecordsource
db.QueryDefs.Refresh
Me.frmSub.Requery
It works, but I can get the form to refresh to show the new data. Below is what I'm doing. Any ideas?
Thanks.
Set qdf = db.CreateQueryDef("qryRecordsource", str)
[frmSub].Form.RecordSource = ""
[frmSub].Form.RecordSource = qryRecordsource
db.QueryDefs.Refresh
Me.frmSub.Requery