How to refer to Field Name with a ? in it in MS Access VBA code
1
vote
1
answer
1236
views
Simple question, but I am new to databases. I have a field called 'ActorRetired?', and in some VBA code I need to set the value of it to -1. But When I try:
Me.ActorRetired?.Value = -1
I get the error 'Compile Error: Expected: Expression' with the question mark highlighted.
How do I refer to the field name without this error? So far I have tried
Me.[ActorRetired?].Value = -1
Me."ActorRetired?".Value = -1
But neither has worked. Please help!
Asked by Amber Cahill
(13 rep)
Oct 6, 2020, 08:08 AM
Last activity: Aug 17, 2021, 10:40 PM
Last activity: Aug 17, 2021, 10:40 PM