Re: Syntax Error
- From: "Graham R Seach" <gseach@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 01:30:47 +1000
Yes, two things: Firstly, you're feeding a string value to the OpenReport
method, when it expects an SQL clause. Remove the single quotes from the
clause. Secondly, you should specify # to indicate a literal date.
strWhere = "[dteInvoiceDate] = #" & Me.txtSpecificDate & "#"
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
"CK" <CK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1555F557-9356-4A7F-AE8D-DAB7E392B52E@xxxxxxxxxxxxxxxx
>I have a form where a user can enter the date so that a list of invoices
> meeting that date will be printed. My code looks like this:
>
> Dim strWhere As String
> strWhere = "'[dteInvoiceDate]=" & Me.txtSpecificDate '"
> DoCmd.OpenReport "rptInvoiceListByDate", acPreview, , strWhere
>
> However I get a Syntax error in string in expression. Is there something
> wrong with the code? Thanks.
> ck
.
- Follow-Ups:
- Re: Syntax Error
- From: CK
- Re: Syntax Error
- References:
- Syntax Error
- From: CK
- Syntax Error
- Prev by Date: RE: pass a calculated form field to a subform field?
- Next by Date: Re: Can't edit access database?
- Previous by thread: Syntax Error
- Next by thread: Re: Syntax Error
- Index(es):
Relevant Pages
|
Loading