By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Opening a form to a specific record

P: 78
I have a form where my user can enter in basic information. I have a button the user presses to save the record, close the form, and open up another form to the most recent record where the user can enter in more detailed data about the record.

This approach works just fine in a single user input situation. However, if I have multiple users doing data input this causes some issues.

For Example:

User A begins the basic input. User A assigns the records primary key (#1) with the first keystroke entered. User B begins to input, assigning a new primary key (#2) to the new record. User A finishes the basic input and presses the button saving the record and opening the second form for more detailed entry. As the second form takes you last record enterend, the record displayed for user A has the primary key of #2. This is not the record User A started with but is the record being prepared by User B.

Essentially, what I'm looking to do is, capture the value of the primary key close the first form and open the second form where the primary key is equal to the capture value.

Any ideas?

Thanks for taking the time to read my post.
Jan 7 '12 #1
Share this Question
Share on Google+
2 Replies


100+
P: 759
If I understand Ok, both forms are bounded to the same table.
An answer to your problem can be to save the primary key into a global variable and use that variable in the open event for the second form. But I think that is not the best approach.

Open the second form without close the first one.
Just hide it.
Then use the filter to open the second form to the desired record.
Jan 8 '12 #2

NeoPa
Expert Mod 15k+
P: 31,186
Opening the second form with a filter that specifies that the [ID] field match the value of the ID from the first form would be the easiest way to proceed. You can also pass the value as an OpenArgs parameter of the DoCmd.OpenForm() call.
Jan 8 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.