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?

Improve company productivity with a Business Account.Sign Up

x
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor President Online Computer Svcs, WNY IncCommented:
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)President Online Computer Svcs, WNY IncCommented:
Also might want to just try:

rsA("[FY16 Annual_Target]")

Jim.
0
 
Dale FyeCommented:
or rsA![FY16 Annual_Target]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.