A
alex
Form's Last Event
Hello,
Using Access ’03…
I set my form’s record source in the form’s on load event; it’s
usually a SQL string.
I subsequently set the record source to “” in the form’s unload event
(this was suggested in posts I've read).
What I’ve described above has worked rather well for me in the past…
On my latest form, I have a lot of code in the form’s on current event—
code such as setting control property values.
When my new form closes, however; I’m getting an error. I understand
the error, but I don’t understand why I’m getting it!
What appears to be happening is that the form’s on current event is
firing after the form’s unload event; i.e., the form’s record source
is set to “” (in the form’s unload event) and then values are
assigned (in the form’s current event) throwing an error. I don’t
understand why the on current event is firing after the form’s unload
event. I even tried putting—me.recordsource = “”—in the form’son
close event, but the form’s current event is even firing after that!
Maybe this is by design, but I’m wondering where I could stick the
code such that it’s the last thing to fire.
I “fixed” the error I was getting by using “on error resume next” in
the form’s on current event, but I hate to do that.
Thanks,
alex
Hello,
Using Access ’03…
I set my form’s record source in the form’s on load event; it’s
usually a SQL string.
I subsequently set the record source to “” in the form’s unload event
(this was suggested in posts I've read).
What I’ve described above has worked rather well for me in the past…
On my latest form, I have a lot of code in the form’s on current event—
code such as setting control property values.
When my new form closes, however; I’m getting an error. I understand
the error, but I don’t understand why I’m getting it!
What appears to be happening is that the form’s on current event is
firing after the form’s unload event; i.e., the form’s record source
is set to “” (in the form’s unload event) and then values are
assigned (in the form’s current event) throwing an error. I don’t
understand why the on current event is firing after the form’s unload
event. I even tried putting—me.recordsource = “”—in the form’son
close event, but the form’s current event is even firing after that!
Maybe this is by design, but I’m wondering where I could stick the
code such that it’s the last thing to fire.
I “fixed” the error I was getting by using “on error resume next” in
the form’s on current event, but I hate to do that.
Thanks,
alex