S
Souris
strSql = " SELECT DISTINCT MyUnionQuery.MyField FROM MyUnionQuery WHERE " & _
" MyUnionquery.MyCode Is Not Null " & _
" and MyUnionQuery.[Activity Date] between " & _
" [Forms]![frmmyform]![dtpStartDate] and
[Forms]![frmMyForm]![dtpEndDate];"
I have one union query which accepts 2 parameter from my form.
The query works when the form is opened.
I need run the query from VBA code.
I got too few paramters message when I run above VBA code.
How should I pass parameter to union query?
should I use db.parameter("[Forms]![frmmyform]![dtpStartDate]") =
[Forms]![frmmyform]![dtpStartDate]? to run the query by VBA?
Your information is great appreciated,
" MyUnionquery.MyCode Is Not Null " & _
" and MyUnionQuery.[Activity Date] between " & _
" [Forms]![frmmyform]![dtpStartDate] and
[Forms]![frmMyForm]![dtpEndDate];"
I have one union query which accepts 2 parameter from my form.
The query works when the form is opened.
I need run the query from VBA code.
I got too few paramters message when I run above VBA code.
How should I pass parameter to union query?
should I use db.parameter("[Forms]![frmmyform]![dtpStartDate]") =
[Forms]![frmmyform]![dtpStartDate]? to run the query by VBA?
Your information is great appreciated,