You only have to declare vars if your module has 'OPTION EXPLICIT' at the top - that applies whether it is a class module or a general module, and only applies to that module. If you do not use option explicit then you can implicitly declare any var by just using it in an assignment statement.
To use the query as the datasource for a subform you set the subform's Record Source property to that query.
From Access Help - which you should learn to use as it has excellent example code
RecordSource Property Example
The following example sets a form's RecordSource property to the Customers table:
Forms!frmCustomers.RecordSource = "Customers"
The next example changes a form's record source to a single record in the Customers table, depending on the company name selected in the cmboCompanyName combo box control. The combo box is filled by an SQL statement that returns the customer ID (in the bound column) and the company name. The CustomerID has a Text data type.
Sub cmboCompanyName_AfterUpdate()
Dim strNewRecord As String
strNewRecord = "SELECT * FROM Customers " _
& " WHERE CustomerID = '" _
& Me!cmboCompanyName.Value & "'"
Me.RecordSource = strNewRecord
End Sub
That last example is for a single record in a form that has it's Default View set to Sinlge Record. If you change it to Continuous Forms, or use a Datasheet view, then it can be populated with a multiple record query.
Easiest way to automate things would be to use the AfterUpdate Event Procedure of the text box that you are going to enter the second date into. Remember to also use the form's Requery method to refresh the display after any update.