Reset Label Caption on Form Close or Unload

S

Samantha

Hi All,
I can't seem to reset some the caption of some labels when the form closes
or unloads. I have tried the following codes on both the form's Unloading
and Closing event but neither works:
Me!lblA.Caption = ""
Me!lblB.Caption = ""
Me!lblC.Caption = ""
Me!lblU.Caption = ""

Any idea why this is the case? I know I can probably reset at the form's
OnLoad event, but I the form already loads very slow because there are
already 4 list boxes that each runs a query when the form opens.
Thanks in advance for all you pointers to the right direction!
 
M

Marshall Barton

Samantha said:
I can't seem to reset some the caption of some labels when the form closes
or unloads. I have tried the following codes on both the form's Unloading
and Closing event but neither works:
Me!lblA.Caption = ""
Me!lblB.Caption = ""
Me!lblC.Caption = ""
Me!lblU.Caption = ""

Any idea why this is the case? I know I can probably reset at the form's
OnLoad event, but I the form already loads very slow because there are
already 4 list boxes that each runs a query when the form opens.


Saving the captions would require you to save the form's
design, which would be a BAD thing.

Go ahead and use the form's Open or Load event, Setting
four captions would use an immeasurably small amount of
time.
 
C

Carl Rapson

Samantha said:
Hi All,
I can't seem to reset some the caption of some labels when the form closes
or unloads. I have tried the following codes on both the form's Unloading
and Closing event but neither works:
Me!lblA.Caption = ""
Me!lblB.Caption = ""
Me!lblC.Caption = ""
Me!lblU.Caption = ""

Any idea why this is the case? I know I can probably reset at the form's
OnLoad event, but I the form already loads very slow because there are
already 4 list boxes that each runs a query when the form opens.
Thanks in advance for all you pointers to the right direction!

Just to add to Marshall's answer, if the 4 text boxes have queries in their
Row Source properties you can move the queries into the Form_Load event to
load the text boxes:

Me.txtBox1.RowSource = "<your query here>"

I'm not sure why it's different, but I've found this speeds up form loading
(sometimes quite drastically).

Carl Rapson
 
M

Marshall Barton

Carl said:
"Samantha" wrote

Just to add to Marshall's answer, if the 4 text boxes have queries in their
Row Source properties you can move the queries into the Form_Load event to
load the text boxes:

Me.txtBox1.RowSource = "<your query here>"

I'm not sure why it's different, but I've found this speeds up form loading
(sometimes quite drastically).


Carl, if I may, I suggest that you lift your nose from the
grindstone, take take a walk about and smell some flowers
;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top