VB Script Microsoft Access, ADO, field name with spaces

Using VB Script to retrieve values from an Access database.  I can use brackets in the sql to wrap around a field with spaces.
When I use the field in the recordset, I get the error.

How do I reference a field with spaces?


Sceenshot of problem
maxdbaseAsked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor PresidentCommented:
One thing you can do is alias the field in the SQL statement:

[FY16 Annual_Target] as Target

Then refer to Target as the field.

Jim.
0
 
maxdbaseAuthor Commented:
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Also might want to just try:

rsA("[FY16 Annual_Target]")

Jim.
0
 
Dale FyeCommented:
or rsA![FY16 Annual_Target]
0
All Courses

From novice to tech pro — start learning today.