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!
Me.ActorRetired_.value
. But I'd recommend you to rename your control/column to some name which does not contain problematic chars, for example, toDoesActionRetired
.Me.
- intellisense will suggest all possible variants, look in the list for your column name as it is interpreted by VBA. When I create a table with the column namedActorRetired?
, then create a form with this table as a rowsource using master, and then try to refer to the column's value in Form_Current - shown expression works correctly. So describe detailed what do you do...Me![ActorRetired?] = -1
- it's been a good long while since I used Access, but I remember something along those lines for fields that aren't directly added as an object to the form.