473,756 Members | 4,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

label is not visible on form

This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visi ble = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Capt ion = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visi ble = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #1
5 11266

I assume this is all happening in the same procedure? Try adding a
Repaint after setting the visible property. Repaint is to graphically
redraw the form. Refresh is related to data.

Me.lblWait.Visi ble = True
Me.Repaint

Mar 25 '07 #2
I *think* that the problen is that a label is a form object, if I recall
correctly.
I used a textbox and (using a Wait() function that I found somewhere -
Access Web?) gave it a 2-second delay so that the user had time to read it
before moving on to the next operation.

Me![txtProgress].Visible = True
Me![txtProgress].SetFocus
Me![txtProgress].Text = "Testing Data Path"
Me.Refresh
DoCmd.Beep
Me![txtProgress].SelStart = 0
Wait 2, False

Here is the Wait() function:

'============== =============== =============== =============== ========
' NOTE: In Visual or Access Basic the unit of greatest precision
' is seconds. Therefore if the Timer is set to wait one second, the
' result could be a delay of anywhere from 0 to 1 second. If a higher
' degree of precision is required, another option is to use the Timer
' event of the form which has the ability to trigger every 1000th of a
' second.
'============== =============== =============== =============== =========

Function Wait(Delay As Integer, DispHrglass As Integer)

Dim DelayEnd As Double
DoCmd.Hourglass DispHrglass
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass DispHrglass)
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) 0
Wend
DoCmd.Hourglass False
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass False)

End Function

HTH,
Don

<dg******@twcny .rr.comwrote in message
news:11******** *************@o 5g2000hsb.googl egroups.com...
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visi ble = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Capt ion = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visi ble = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #3
dg******@twcny. rr.com wrote:
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visi ble = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Capt ion = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visi ble = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah
Yes. What is the Caption before you make it visible? If Null or a
space it would display but you wouldn't know unless it had a border.

I'd do this test if its another problem. Make the label visible when
you open it. Comment out (for testing only) the SQL manipulation so the
New Caption line executes. Does it work? I don't believe it has
anything to do with your SQL process but I could be wrong.
Mar 25 '07 #4
DoEvents yields control to the system, so it can perform functions that are
waiting to occur, for example, updating the Visibilty or content of your
Label Control. I am not certain about the other suggestions, as some "system
requests" from VBA code are just queued up waiting for the OS to get control
again (as it does with DoEvents... for which see the Help in any module
window).

Larry Linson
Microsoft Access MVP

<dg******@twcny .rr.comwrote in message
news:11******** *************@o 5g2000hsb.googl egroups.com...
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visi ble = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Capt ion = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visi ble = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #5
Thank you very much. Both of the first 2 suggestions worked very well.

Deborah

On Mar 25, 12:26 pm, dgard...@twcny. rr.com wrote:
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visi ble = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Capt ion = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visi ble = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
30035
by: Xerxes | last post by:
Hi, can you tell me how I can make a <label> hidden? I have hidden the field after the label: var M_Hide = isNS4?'hide':'hidden'; var M_Show = isNS4?'show':'visible'; ..... <label id="uid">UserID: </label> <input name="UserID" type="text" value="" size="20"> <script language="Javascript1.2" type="text/javascript1.2">
5
8536
by: dcstech | last post by:
I have a label that will not display. On the form load event I wrote "label1.visible=false". when my routine get at the end of the code I inserted "label1.visible=true". I have had a similar problem with vba in excel and I had to put a wait statement after telling the label.visible=true. This solved the problem in Excel. In VB.Net I used the thread.sleep after telling the label.visble=true and this did not help. When I said "wait" I...
7
2980
by: Jared | last post by:
Here is my situation. I have multiple labels on a form but only certain ones will become visible while using the form. Depending on which check box(s) you pick, on another form, determines the labels that appear. I have that much working as of now. What I need to know is, how do I format the labels to align underneath one and other. So when I check the first check box, the corresponding label appears and when I check the third check box...
2
3930
by: Xarky | last post by:
Hi, I am trying to create a Label for a Windows Form, with my own code. Its not being visible. The code being used is the following. Label x = new Label(); x.Name = "node1"; x.Location = new System.Drawing.Point(200, 200); x.Text = "Hello"; x.TabIndex = 1; x.Show();
2
2426
by: John Holmes | last post by:
I would like to turn on a label control in javascript with the onfocus event of another control by setting the Visible property to true. When I try and reference this label control it says "Microsoft JScript runtime error: 'document.Form1.lblSigGrantor' is null or not an object". I wrote a loop and iterated through the elements for the form and this control doesn't show up. Code listed below, please help. Thanks, John Holmes
31
7239
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
3
2421
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me why not? Below is an working VB.Net example to illustrate what I mean.
2
2602
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I have a Label on a Windows form (Version 1.1.4322) and while I iterate recursively through a method I want to show the name of the current file being copied to another directory. The Label is not visible until the backup begins, at which point I resize the form to show the Label and a ProgressBar. As each file is copied, the Label is updated:
9
8023
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is behind the label ... and this looks ugly ... :-)) When I set the label with "SendToBack", it completely disapears. I also tried to set the child form like "BringToFront" but this also does not help.
0
9325
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9152
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9716
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4996
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3676
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2542
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.