Re: Translation of SQL for VBA
- From: "Ken Snell \(MVP\)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 Jan 2006 19:02:54 -0500
What are you doing with the SQL string when it's built? That can affect how
you would handle this.
In general, you would concatenate the actual value from the parameter into
the string:
MyString = "WHERE VcValue.Site=" & [forms]![VcValueSubform]![site] & _
" AND VcValue.Year=" & [forms]![VcValueSubform]![txtSubyear]
(above assumes that both fields are numeric).
--
Ken Snell
<MS ACCESS MVP>
"Kou Vang" <KouVang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AAA8A202-0E7F-4CE1-864D-ACFAB3317B8F@xxxxxxxxxxxxxxxx
>I have not been able to find a translation of 2 conditions of a query to be
> properly coded in VBA. I know this is pretty basic, but I'm struggling.
> How
> do I say this in my strSQL string in VBA? Thanks.
>
> WHERE (((VcValue.Site)=[forms]![VcValueSubform]![site]) AND
> ((VcValue.Year)=[forms]![VcValueSubform]![txtSubyear]));
>
.
- Follow-Ups:
- Re: Translation of SQL for VBA
- From: Kou Vang
- Re: Translation of SQL for VBA
- Prev by Date: Re: access query that uses visio to draw data link analysis flowchart
- Next by Date: List of Dates
- Previous by thread: Using Shell method to "Print" pdf and then pausing until pdf compl
- Next by thread: Re: Translation of SQL for VBA
- Index(es):
Relevant Pages
|