Custom userform does not hold values

S

Susan Lammi

I have created a custom userform with 3 text boxes and 2 command buttons.

The textboxes are set to Enabled=False to protect the data from accidental
change
a button sets the textboxes to Enabled=Yes to modify the data

Each time I open the form the textboxes are empty, the values I enter are
not being saved. I have tried several approaches but with no luck...

Can someone help

Sue
 
S

Sue Mosher [MVP-Outlook]

Userforms have no place to hold data unless you provide the code to store it
somewhere and load it from that same place.
 
S

Susan Lammi

for a text box name txtExcel

I am using the following code on the afterupdate event of the text box

txtExcel.tag=txtexcel.value

and in the initialize event for the form

txtexcel.value=txtexcel.tag
 
S

Sue Mosher [MVP-Outlook]

When you close the form, all changes to the UI are discarded. When you open
the form a second time, it initializes with the values of the stored
userform.

Repeating: If you want data entered in your userform to be retrievable
later, you must specifically save it somewhere -- a file, the registry,
Outlook item etc.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Susan Lammi

Thanks I think I've got it now....


sue
Sue Mosher said:
When you close the form, all changes to the UI are discarded. When you open
the form a second time, it initializes with the values of the stored
userform.

Repeating: If you want data entered in your userform to be retrievable
later, you must specifically save it somewhere -- a file, the registry,
Outlook item etc.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



luck...
 
Top