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()
MsgBox test
Application.LoadFromText acForm, "frm_Forms", "C:\My
Documents\\Form\frm_Forms.txt"
End Sub
Private Sub Form_Load()
test = "some value"
End Sub
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?
thanks
bm
"bm" <bm@dnn> wrote in message
news:0d4601c36be3$1cea9630$a501...@phx.gbl...
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
www.datagnostics.com
(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?