Unanswered: Subform showing only one record with dynamic query string
I am new to the Access Subfroms.
I have a problem showing the records in an unbound subform.
I have an unbound subform named frmSubStock in frmMainStock. There is no master/child relation at all.
There is just one button, RUN.
When I click run, the query result should be displaying in the subform.
The code i am using:
Dim strqname,SQL As String
SQL = "Select * from stock"
db.CreateQueryDef "qryTemp", SQL
strqname = "qryTemp"
Me.frmSubStock.SourceObject = "Query." & strqname
That's all. Whenever I hit RUN button, only just one last record is showing in the query. When i tried with this command, all records are returned in the new query window: