Form Automatic Refresh/Stay in Same Field

  • Thread starter CDG via AccessMonster.com
  • Start date
C

CDG via AccessMonster.com

I have a continous form to display mulitple records. There are multiple
users updating information. I need to have the form automaically refresh and
then to stay in the same record and field. It is working well except for one
thing. When the system automatically refreshes, and the user is an a field
an error message occurs that the format is not valid. The field is a short
time field with an input mask of 00:00;0;_. If the user is in the middle of
entering the time, an error message appears and wants to take the user to the
debug area because the input mask was not recognized. Is there a way to fix
this. I am using the following for the OnTimer event:

Dim ControlToRemember As String

ControlToRemember = Screen.ActiveControl.Name
RecordToRemember = Me.CurrentRecord - 1

Me.Form.Requery

DoCmd.GoToRecord , , , RecordToRemember

DoCmd.GoToControl ControlToRemember

Thanks for your help,
CDG
 
L

Linq Adams via AccessMonster.com

This is a very poor idea! Why are you doing a Requery with the OnTimer event?
Why not simply Refresh the form? That's exactly what Refresh is for!
 
C

CDG via AccessMonster.com

I am using OnTimer, because it must automaically refresh. Since it is a
multi user enviornment, requery is needed to ensure what my co-worker entered
will appear on my screen. Also, after the requery, the cursor needs to
remain in the same record and field.
As mentioned earlier, this is causing issues with a field. If the screens
requeries while a user is entering information in the short time field an
error message appears.
 

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