Requery Form on Insert - Prevent record flickering

  • Thread starter Thread starter Alan Z. Scharf
  • Start date Start date
A

Alan Z. Scharf

1. I have a form sorted by LastName, FirstName, bound to SQLServer view.

2. The underlying table has a primary key on ContactID (Identity) and an
index on LastName, FirstName.

3. The view underlying the form also is sorted on LastName, FirstName.

4. When the form requeries after an Insert via stored procedure, it visibly
goes back to the lowest ContactID Identity value, before going to newly
added record via: DoCmd.GoToRecord , , acLast.

5. Is there a way to prevent this flashing of the lowest Identity value
record before arriving at newly added record?

Either freezing the form, or some other approach?

Thanks very much.

Alan
 
Probably come from the fact that you are using a Requery after the insert,
which is done via a stored procedure instead of being done by the form
itself. Obviously, the best solution would be to make the insert directly
into the form. You can also try to use « Application.Echo False » followed
by « Application.Echo True » at the end. Don't forget to use the on error
instruction, otherwise, in case of error, Access will be left in the don't
display mode and gives you the (false) impression that it doesn't work
anymore. For an exemple, see:

http://home.clara.net/tkwickenden/codeex/2-93-95-99.htm

In your case; Form.Repaint could also be handy.

S. L.
 
Sylvian,

Thanks very much for your reply.

The application Echo sounds like what I was looking for. I'll try it.

I'm using a multitable insert so wanted to keep it in SP as transaction and
to various checks. Also want to use same procedure for Web version.

Alan..
 
Back
Top