How can i do for see to Label caption change (1 Viewer)

shu-shu-shuk

New member
Local time
Tomorrow, 06:36
Joined
Apr 9, 2022
Messages
5
Hi
How can i do for see to Label caption change (source is in progres)
I tried this module
'Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal milliseconds As LongPtr)'
It's possible to wait, but I can't see the change.
OTL
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:36
Joined
Feb 28, 2001
Messages
27,128
You should not have to wait at all. If you do something like this:

Code:
control-name.Caption = "Some text"
Me.Repaint

then any caption changes should be immediately visible. Note that if you make a change that changes an underlying recordset that is currently visible, it is possible IN THAT CASE to require a Me.Requery instead. But captions can get by with .RePaint

If you are doing several captions at once, just do the RePaint after the last one of the sequence. They will all appear to change at once.
 

shu-shu-shuk

New member
Local time
Tomorrow, 06:36
Joined
Apr 9, 2022
Messages
5
Thank you for your help.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 22:36
Joined
Sep 12, 2006
Messages
15,634
A "doevents" at the end might also do the same job of "publishing" all pending screen updates.
 

Cronk

Registered User.
Local time
Tomorrow, 07:36
Joined
Jul 4, 2013
Messages
2,771
Me.Repaint is not necessary
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:36
Joined
Feb 28, 2001
Messages
27,128
Cronk, OP was not seeing the label change. In fact, ANYTHING that implied a .Repaint would have worked. That was just a simple solution to force the issue.
 

Cronk

Registered User.
Local time
Tomorrow, 07:36
Joined
Jul 4, 2013
Messages
2,771
I've never had to use Repaint after a label caption change. But you are right on a belts and braces basis.
 

Users who are viewing this thread

Top Bottom