Feb 22 2007, 09:34 AM
I am not really sure if this is a form issue or not. I just was not sure where to post this.
I am running Access 2002 with a SQL back end for the database in question.
The forms were original run from queries but are now being run from the tables to make them faster.
Since I have done that the users are complaining of an issue when they minimize and then maximize the form.
Here is a little history to explain the process they do.
The open the form and have to hit the New Record button to add a new record. They do that and when they are finished with the record hit the New Record button again. So their form is on a blank record. They will then minimize the form and go into another form. When they maximize the first form to do more data entry the form will go back to the first record in the table instead of being on the New Record they thought it would be on.
Apparently this was working that way when the form was based on a query but since I change it to be based on the Table it started going back to the first record.
Is there anyway to fix this?
If I am not clear about this let me know.
Feb 22 2007, 10:13 AM
It sounds to me that a Requery action on the first Form was introduced in error since after a Requery, the CurrentRecord, by default, will be the first record which is exactly what you described ...
The problem for you is to find the code that requeries the first Form. It can be in the code window of the first Form e.e. the Form_Activate Event but it can also be outside the first Form.
Feb 22 2007, 10:20 AM
That is it!!!
However I do need the Requery on there for other reasons - so I guess the users will just have to deal with it.
Thanks so much.
Feb 22 2007, 10:58 AM
You should be able to use VBA code to find out whether the Form is on a NewRecord or alternatively, the CurrentRecord of the Form and temporarily store the value that uniquely identifies the CurrentRecord, e.g. the PK value, in a VBA variable.
After the Requery (which makes the first Record the CurrentRecord), you can use code to make the NewRecord the CurrentRecord again or change the CurrentRecord to the previous CurrentRecord using the value stored in the VBA variable previously if appropriate ...
Feb 22 2007, 11:01 AM
I am not a big code person. That is where I struggle with Access.
Do you know what that code would be?
Feb 22 2007, 12:18 PM
Please post a sample copy of your database (compact first then zip to < 500 kB as UA allows only max. of 500 kB) so that we can see your requery code to work out the suitable mods.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here