Such a thing as Before Current for forms?

M

markmarko

On my frmSalesOrderEntry (single form), I have code, triggered by the
OnCurrent event, to look at the current record and make various controls
visible and/or enabled depending on the data in the record. Subsequently,
every time I move to a new record, it displays the record, then runs the
code, then redraws the whole page.

My question is this... Is there a way to be able to have it wait until the
code has run to draw the page, so that the page doesn't 'flicker' when the
page is redrawn? I was hoping for something akin to a BeforeCurrent event,
but since that doesn't seem to exist, if there are other options.

I had thought it might be caused by a requery in the code, but there is not
one in normal circumstances.
 
K

Klatuu

How is it "redrawing the whole page"?
Is it with a repaint or some other method?

There is not such event as you asked.
You might try this trick to avoid the flicker. The Echo method of the
Application object turns off displaying any changes to the screen. Set it
Off before your code, and turn it back on after. If you have an error
handler, you may want to turn it on there also, so the screen will start
echoing again.

Private Sub Form_Current()

Application.Echo False
'''' Your code
Application.Echo True
 

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