I was originally having a problem referencing a submacro within the form so I moved the submacro outside and referenced it that way. My macro tries to set the properties of a number of text boxes in the form. I want to lock/unlock all of the fields based on a toggle button int he form.
In the macro I have the following
Code:
SetProperty
Control Name [Forms]![frmRMA]![txtRMA]
Property Locked
Value =[LocalVars]![varLockedYesNo]
Every time I run the code it tells me that the control name is mispelled or does not exist. I have tried without brackets as well and I get the same error. I've even tried with/without periods instead of exclamation points. Same error.
I've tried referencing a different text box, same error.
When the control name box is empty I can use the intellisense to use what it suggests. It finds all of the references, first with Form! then it finds the form frmRMA, then it shows all of the controls with a wrench icon next to each. Even with the suggested sytax it still throws the same error suggesting that the control name is mispelled.
The wierd thing is I can use that same reference string ("[Forms]![frmRMA]![txtRMA]") in an expression and get the value and it works just fine. I only seem to have this problem with the SetProperty function. I've googled it and I've seen a few people have the same problem but I have not yet found a solution.