incorrect syntax

  • Thread starter Thread starter David hunt
  • Start date Start date
D

David hunt

I am trying to create a recordset and then run a process
on said record set.

********* code ***************

Dim db As DAO.Database
Dim qd As DAO.QueryDef
Dim rs As DAO.Recordset

Set db = CurrentDb
Set qd = db.Querydefs("Test_1")
' Test_1 is SELECT * FROM Data WHERE account='9999'
Set rs = qd.OpenRecordset

' sets impression variable
Impression = [Total Impressions Printed] * 2

*************

I'm not referencing the Total Impressions Printed variable
within the DB with the correct syntax?
 
David hunt said:
I am trying to create a recordset and then run a process
on said record set.

********* code ***************

Dim db As DAO.Database
Dim qd As DAO.QueryDef
Dim rs As DAO.Recordset

Set db = CurrentDb
Set qd = db.Querydefs("Test_1")
' Test_1 is SELECT * FROM Data WHERE account='9999'
Set rs = qd.OpenRecordset

' sets impression variable
Impression = [Total Impressions Printed] * 2

*************

I'm not referencing the Total Impressions Printed variable
within the DB with the correct syntax?

What exactly is [Total Impressions Printed]. You refer to it as a
variable, but variable names are not allowed to have spaces in them so what
is it? Is it a field from the RecordSet? If so you would use...

Impression = rs![Total Impressions Printed] * 2
 
Back
Top