Full Version: Select Form From Another Form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
jdepinet
I have a loaded form "frmAlarm" that is unfiltered (It is a new record that I save before the next ->) On frmAlarm the user selects a command button and it pops up "frmAccount" that is not related to frmAlarm. When I close frmAccount frmAlarm goes to the first record in the table. This is what I want: When the user closes frmAccount it displays the same record in frmAlarm that was displayed before losing focus to frmAccount.

FYI When the record in frmAlarm is not new (Filtered) it works fine. Thanks John
jhcarrell
Can you post an example db of problem you're encountering. I'm pretty sure I can sort this out for you, but i'll need see your setup for opening and closing the form.

Thanks.
jdepinet
I think I jusy need code to select a record on the form when I close another form. Really don't want to upload because I have data in the tables and I'm hoping to get a answer or find the answer in a short amount of time. Any other help out there? Thanks John
jdepinet
Ok, this is causing the change of record: OnClose Forms!frmalarm.Requery

When I take it out it stays on the same record. Do I need to add "me" in there to stay on the same record?
jhcarrell
How are you opening the frmAccount? macro or VBA? How are you closing the frmAccount? macro or VBA? In either case, please provide the full code on the buttons for the method you are using.

Thanks.

Edit: n/m answered while I was typing.
jhcarrell
QUOTE (jdepinet @ Jan 9 2011, 10:16 AM) *
Ok, this is causing the change of record: OnClose Forms!frmalarm.Requery

When I take it out it stays on the same record. Do I need to add "me" in there to stay on the same record?


What is the purpose of the requery as you stated the forms are not related?

If the information from frmAccount's table has no impact on frmAlarm's table, I'm not seeing why you really need to requery.

Thanks.
jdepinet
When frmAccount opens it show all of the account activity for the current frmAlarm. frmaccount uses a listbox (query) based off of the pk in frmAlarm. From frmAccount the user can add a new activity that could change the balance field on frmalarm. I'm just trying to show the updated account balance field on frmAlarm.
jhcarrell
See this link

Hope that helps.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.