Screen paints, and repaints, echo(off) no worky

M

markmarko

We've got a frmSalesOrder form. It has 4 tab page, and a couple of the tab
pages have 2-4 subforms.

The onCurrent procedure, among other things, checks certain pieces of data
and based on the data, enables/disables or visibles/invisibles various
controls as appropriate. For example, if the Sales Order record already has a
matching Install Order, the btnCreateMatchingInstallOrder button will be
disabled.

The problem (annoyance?) is that when the user goes to a new record, the
form will immediately show the new data, then a second or two passes while it
processes the VBA, and then basically repaints the form (ie it flickers
once).

I'm sure I can streamline the code in the future, but even then it will take
a moment to run.

Is there any way to make it show new records faster? Or at least eliminate
the draw, wait, redraw thing? I think it confuses my users.

I've tried application.echo false (and docmd.echo (false)) at the beginning
of the oncurrent procedure, but it doesn't seem to matter.

Any advice would be appreciated!
 
M

markmarko

Here's an example of another instance...

If the users clicks the Refresh button, I would expect that it would not
show the requery, but just show the current record after the requery and
finding the correct record.

Instead, it shows record 1 from requerying, then goes to the record...

Why isn't echo off preventing that stuff from being shown?

--------

Private Sub Refresh_Click()
If Not (IsNull(SalesOrderID)) Then
TempVars![SalesOrderToGoTo] = [SalesOrderID].Value
End If
RefreshData
TempVars![SalesOrderToGoTo] = Null
End Sub

Public Sub RefreshData()
On Err GoTo ExitCode:
Application.Echo False
Me.Requery
GotoSpecificRecord
ExitCode:
Application.Echo True
End Sub
Public Sub GotoSpecificRecord()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SalesOrderID] = " & Str(Nz(TempVars![SalesOrderToGoTo], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
 

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