Control Visible update delay....? (1 Viewer)

zozew

Registered User.
Local time
Tomorrow, 01:10
Joined
Nov 18, 2010
Messages
199
Hi All,

Im setting the Visible property of a textbox depending on a value in a record (Archived = True or False)

The Problem is that when i browse through the records it doesn't update the controls visability...or let me rather say it doesn't update. If i move any other window above the Access db window and then move it away it shows the correct state...?

So...is there a part im missing regarding refreshing the drawn objects in a form??

I'm running the "Visable" code check in the Forms OnCurrent event...is that wrong?

THx
 

boblarson

Smeghead
Local time
Today, 10:10
Joined
Jan 12, 2001
Messages
32,059
On Current should be fine but sometimes things have a way of just not repainting, so try adding this after the line which sets the visibility:

Me.Repaint
 

zozew

Registered User.
Local time
Tomorrow, 01:10
Joined
Nov 18, 2010
Messages
199
Me.Repaint

I have but no update/refresh, but as soon as i move/Resize or do any other kind of action to the actual access window the control gets updated...hmmm very strange...

There is no flicker of the form with the repaint action, but if i move the divider bar between the form/datasheet i get a flicker and the control updates (As with all other actions moving/resizing etc)
 

zozew

Registered User.
Local time
Tomorrow, 01:10
Joined
Nov 18, 2010
Messages
199
Well...it kinda works now, but i was hoping i wouldn't have to use the refresh command as it is already in the OnCurrent and there are quite some calculations to and from the backend for each record...so there is an increased delay now between browsing records....:(
 

boblarson

Smeghead
Local time
Today, 10:10
Joined
Jan 12, 2001
Messages
32,059
So REPAINT (not refresh or requery) didn't work for you? Repaint just redraws the form and doesn't affect any data whereas refresh or requery does. And by the way do you know the difference between Refresh and Requery?
 

zozew

Registered User.
Local time
Tomorrow, 01:10
Joined
Nov 18, 2010
Messages
199
So REPAINT (not refresh or requery) didn't work for you? Repaint just redraws the form and doesn't affect any data whereas refresh or requery does. And by the way do you know the difference between Refresh and Requery?

No Repaint didn't work or half works, as i explained before i need to do some kind of action after the repaint: Move another window above the access window or move the splitter bar (Spreadsheet) in the form or just move the access window a pixel and the changes are made visible in the form. The only way i could make the changes visible without any "user" interaction is with "Me.Refresh" after the codeline that makes my control visible/Invisible

I was hoping Repaint would work as it seem most logical, but im using refresh for now...

The definition from MS on Refresh and Requery is :

office.microsoft.com

Refreshing records only updates the data that already exists in your datasheet or form. It does not reorder records, display new records, or remove deleted records and records that no longer meet specified criteria. To perform those tasks, you can requery the records. You can requery data manually, by using a macro, or by using code.

So i hope i understand the difference :)
 

Users who are viewing this thread

Top Bottom