Here is code from my simple form with one button and load
method setting form instance variable to some value. First
click on the button will produce message with some value.
Second click on this button will produce empty message.
Private test As String
Private Sub Command0_Click()
Application.LoadFromText acForm, "frm_Forms", "C:\My
Private Sub Form_Load()
test = "some value"
I also noticed that call to LoadFromText changes or does
something to form variable set to instance of an object.
I would like to know why LoadFromText called from one form
to load another form changes (clears) one form's instance
variables? Is there a work around it?
"bm" <bm@dnn> wrote in message
It's a hidden method. You can set the Object Browser to show hidden
members, and you'll see it.
Dirk Goldgar, MS Access MVP
(please reply to the newsgroup)
Offhand I'd say that the method probably either *has* to reset the VB
project because the form you're importing has a code module, or else it
does it anyway just because the form *might* have a code module. I very
much doubt you can keep this from happening, in which case your only
workaround is to find a way to persist your instance variables. The
most obvious way to do this would be to save their values in a table and
reload them from there after the import.
SaveAsText and LoadFromText being undocumented methods (though
admittedly handy), do you think it's a good idea to build any
application features on them?