J
Joan
Hi,
I am wanting to open a recordset using a SQL statement but am having
problems with the formatting of the expression. Could someone tell me what
I am doing wrong? This is what I have:
Dim DB as Database
Dim rstInvoices As DAO. Recordset
Set DB = CurrentDb
Set rstInvoices = DB.OpenRecordset "SELECT * FROM Invoices WHERE
(((Invoices.[Invoice Number]) Between
Forms!frmPrintReportsDialog!FromInvoice And
Forms!frmPrintReportsDialog!ToInvoice) And ((Invoices.Type)="INV"))" ,
dbOpenDynaset
I get a message that it expects the end of statement when Access gets to the
second " in front of INV. How should I write this instead?
I want to loop through the Invoice records between [FromInvoice] and
[ToInvoice] on the frmPrintReportsDialog form and print out each invoice
separately so that the page number information is correct for each
customer's Invoice Statement. The control source for the page information
on the report is: ="Page " & [Page] & " of " & [Pages]
Joan
I am wanting to open a recordset using a SQL statement but am having
problems with the formatting of the expression. Could someone tell me what
I am doing wrong? This is what I have:
Dim DB as Database
Dim rstInvoices As DAO. Recordset
Set DB = CurrentDb
Set rstInvoices = DB.OpenRecordset "SELECT * FROM Invoices WHERE
(((Invoices.[Invoice Number]) Between
Forms!frmPrintReportsDialog!FromInvoice And
Forms!frmPrintReportsDialog!ToInvoice) And ((Invoices.Type)="INV"))" ,
dbOpenDynaset
I get a message that it expects the end of statement when Access gets to the
second " in front of INV. How should I write this instead?
I want to loop through the Invoice records between [FromInvoice] and
[ToInvoice] on the frmPrintReportsDialog form and print out each invoice
separately so that the page number information is correct for each
customer's Invoice Statement. The control source for the page information
on the report is: ="Page " & [Page] & " of " & [Pages]
Joan