Hello everyone.
I did an internet search and a search on this site before posting this. I couldn't find an answer to my question. I may not have been putting in the correct criteria, though.
I have a userform that is pulling information from a spreadsheet. It's for viewing a products information. I have an edit button outside of the multipage. Instead of creating two identical forms and having a viewing one that is locked down and an editable one, I'd like to just use one form and make it where the users can't edit the data in the textboxes, listboxes, option buttons, etc...
I have found a solution to this by writing code for each text box, such as: txtName.locked=true.
That allows me to keep the user from editing it. I can then unlock it when they hit the edit button and make the edit button invisible while making a save button visible, or maybe just changing the text. I haven't decided yet.
Anyway, I don't have a lot of controls on this form, but I'd still like something more elegant than coding a lock for every text box and control on each page. Ideally, I'd like to be able to do something like: MultiPage1.tabBasic.locked = true.
That would lock down the whole tab without making it invisible. VBA doesn't like me when I try that, though. I've also found the code for disabling the entire tab, but that doesn't work because it's not visible to the user. I'd like them to be visible and not greyed out, which is why I'm using locked instead of enabled.
Even this solution isn't ideal as the cursor still appears in the text boxes, even if you can't edit them. Can anyone help me with this issue? Thanks.
Dalton325
I did an internet search and a search on this site before posting this. I couldn't find an answer to my question. I may not have been putting in the correct criteria, though.
I have a userform that is pulling information from a spreadsheet. It's for viewing a products information. I have an edit button outside of the multipage. Instead of creating two identical forms and having a viewing one that is locked down and an editable one, I'd like to just use one form and make it where the users can't edit the data in the textboxes, listboxes, option buttons, etc...
I have found a solution to this by writing code for each text box, such as: txtName.locked=true.
That allows me to keep the user from editing it. I can then unlock it when they hit the edit button and make the edit button invisible while making a save button visible, or maybe just changing the text. I haven't decided yet.
Anyway, I don't have a lot of controls on this form, but I'd still like something more elegant than coding a lock for every text box and control on each page. Ideally, I'd like to be able to do something like: MultiPage1.tabBasic.locked = true.
That would lock down the whole tab without making it invisible. VBA doesn't like me when I try that, though. I've also found the code for disabling the entire tab, but that doesn't work because it's not visible to the user. I'd like them to be visible and not greyed out, which is why I'm using locked instead of enabled.
Even this solution isn't ideal as the cursor still appears in the text boxes, even if you can't edit them. Can anyone help me with this issue? Thanks.
Dalton325