Screen FLicker when go to next record

chrisjames25

Registered User.
Local time
Today, 13:22
Joined
Dec 1, 2014
Messages
404
Hi I have a input form with a subform showing what i have previously input

i use the following code on an enter info command button

Code:
Private Sub Cmd_enter_Click()
Application.Echo False

ApplyData

DoCmd.GoToRecord , , acNext
'DoCmd.RunCommand acCmdRecordsGoToNext
Me.Sub_Batch.Form.Requery
Application.Echo True



End Sub

THe applydata sub takes data from unbound textboxes and puts them in bound text boxes.

My issue is when i click the enter info command button i get a bad screen flicker. I have gone throught the code line by line and the flicker dissapeared if i remove the go to next record part of the code.

ANy idea why this line would create a screen flicker or if the code can be changed to remove the flciker?
 
Add the line DoEvents after ApplyData sub

Why have you got two commands for moving to the next record?
The first one is preferable

You shouldn't need to requery after moving to the next record.
That could cause flicker
Try commenting that out

Finally do you have a timer event on your form?
If so, try disabling it temporarily
 
The bigger question is why are you using an unbound form? Access is a RAD tool. Let it do its thing for best results. You really cannot do it better.

Looking at your code, what is the point of moving to a new record after you populated the previous one?
 
Hi Pat

Apologies the form is not unbound it is bound to a table.

I have controls that are unbound in the form and when i click my enter command button it runs tests on each input i.e. are they empty etc or compliant with the format of table etc and then transfers the data to bound textboxes in the same form that are invisible and then i want it to move to the next record for inputting.

Hope that helped clear it up
 
Hi Pat

I have controls that are unbound in the form and when i click my enter command button it runs tests on each input i.e. are they empty etc or compliant with the format of table etc and then transfers the data to bound textboxes in the same form that are invisible and then i want it to move to the next record for inputting.

My guess is that you've just answered the question of why the flickering is happening. The real question is why are you doing this song and dance instead of simply entering data into the appropriate Controls...you don't need to use Unbound Controls in order to do validation of the entered data...you simply do that in the Form_BeforeUpdate event.

Linq ;0)>
 
I would place a small bet that the hidden bound boxes are possibly being set with .Text properties as well.

As others have said you don't need to jump through all these hoops. Simply have the validation in the forms before update event.
 

Users who are viewing this thread

Back
Top Bottom