Unanswered: changing a control attribute when 'calling' a form
I have 2 command buttons on a form, which call the same form. The buttons open the same form, which has 2 sub-forms, but one button sets one of the subforms to .enabled = false and .visible = false : this is all working as it should.
My problem is attempting to set the input mask to different settings on the main called form according to the button pressed on the calling form.
button1.....opens main form ........displays subform1 & subform2
mainform field taxfilenumber has input mask "TFN "000\-000\-000;0;_
works as required.
button2...opens mainform.......displays subform1 & not subform2
works as required, so far;
but I need to set mainform field taxfilenumber input mask to "ABN "000\-000\000;0;_ (or some other change.
have tried in code various optiions:
forms!mainformname.controlname.[input mask] = "xxxx"
after opening the mainform have tried me!mainformname.control.[input mask] = "xxx"
How do I change the attribute, without having to have 2 forms?
object doesn't support this method
unable to find field forms!
many thanks. I ended up with a similar format with:
.inputmask = "\ABN "&"000\-000\-000;0;_"
I set up the input mask for the TFN in the initial table, so I only had to call the one format ie as above. Perhaps not as elegant as your solution.
As an additional question, which do you consider more acceptable (commercially); the ommission of an inputmask in the table and then setting up two inputmasks via code as you have replied, or the setting up of an input mask in the table and then calling one change via code. I know there will be arguments for both, and consistency, preferences and standards arguments could ensue, but I was wondering what you had seen the most.