Change recorsource for child form based on Criteia selected in Parent form VBA ACCESS 2010

I am trying to get a child form to changes its record source based on criteria the user selects from the parent form.  the below does create the record select string correctly, but I cannot get it to recognize the child form.  I have commented out the requery as it errors our when  it hits the recordsource setting.

Private Sub FilterForm(strFilter As String)
On Error GoTo ErrorHandler
Dim strSelect As String
Dim dteStartDate As Date
Dim dteEndDate As Date
Dim strAccountID As String
Dim strWhere As String
Dim intLength As Integer

strSelect = "SELECT * FROM tblAccountTransactions"

If Not IsNull(Me.txtStartDate) And Not IsNull(Me.txtEndDate) Then
    strWhere = "(tblAccountTransactions.TransactionDate Bewteen #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#) AND "
ElseIf Not IsNull(Me.txtStartDate) And IsNull(Me.txtEndDate) Then
    strWhere = strWhere & " tblAccountTransactions.TransactionDate >=  #" & Me.txtStartDate & "# AND "
End If

If Not IsNull(Me.cboAccount) Then
     strWhere = strWhere & " tblAccountTransactions.AccountId = '" & Me.cboAccount.Column(0) & "' AND "
End If

intLength = Len(strWhere) - 5
strWhere = Left(strWhere, intLength)

If strFilter = "Filter" Then
    Forms!frmTransactions!sfrmaccountTransactions.Form.RecordSource = strSelect & " WHERE " & strWhere
'    Me.sfrmaccountTransactions.Forms.Requery
ElseIf strFilter = "Clear Filter" Then
    Forms!frmTransactions!sfrmaccountTransactions.Form.RecordSource = strSelect
'    Me!sfrmaccountTransactions.Form.Requery
End If

Exit_ErrorHandler:
    Exit Sub
ErrorHandler:
    MsgBox "Error Number: " & Err.Number & " Description: " & Err.Description
    Resume Exit_ErrorHandler
End Sub
Sandra SmithRetiredAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sandra SmithRetiredAuthor Commented:
Got the below to work
Private Sub FilterForm(strFilter As String)
On Error GoTo ErrorHandler
Dim strSelect As String
Dim dteStartDate As Date
Dim dteEndDate As Date
Dim strAccountID As String
Dim strWhere As String
Dim intLength As Integer

strSelect = "SELECT * FROM tblAccountTransactions"

If Not IsNull(Me.txtStartDate) And Not IsNull(Me.txtEndDate) Then
    strWhere = "(TransactionDate Between #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#) AND "
ElseIf Not IsNull(Me.txtStartDate) And IsNull(Me.txtEndDate) Then
    strWhere = strWhere & " TransactionDate >=  #" & Me.txtStartDate & "# AND "
End If

If Not IsNull(Me.cboAccount) Then
     strWhere = strWhere & " AccountId = '" & Me.cboAccount.Column(0) & "' AND "
End If

intLength = Len(strWhere) - 5
strWhere = Left(strWhere, intLength)
If strFilter = "Filter" Then
    strSelect = strSelect & " WHERE " & strWhere
    [Forms]![frmTransactions]![sfrmTransactions].[Form].RecordSource = strSelect
    [Forms]![frmTransactions]![sfrmTransactions].[Form].Requery
ElseIf strFilter = "Clear Filter" Then
    [Forms]![frmTransactions]![sfrmTransactions].[Form].RecordSource = strSelect
    [Forms]![frmTransactions]![sfrmTransactions].[Form].Requery
End If

Exit_ErrorHandler:
    Exit Sub
ErrorHandler:
    MsgBox "Error Number: " & Err.Number & " Description: " & Err.Description
    Resume Exit_ErrorHandler
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra SmithRetiredAuthor Commented:
resolved myself.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.