incorrect syntax

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?
 
R

Rick Brandt

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top