CanuckBuck
Registered User.
- Local time
- Today, 01:01
- Joined
- Apr 27, 2019
- Messages
- 31
I need some direction regarding form interactions.
I have a view/search form that users use to either find and edit an existing record by clicking an Edit This Record button OR add a new record by clicking an Add New record. When they click either button I open a form in either Edit or Add mode;
Edit;
Add;
I've attached screenshots of the view/browse and edit forms so you can see what I'm working with.
Where I'm struggling is how to efficiently/reliably update the view/search form when the user is finished editing an exiting record or adding a new one.
There are a number of scenarios I need to handle;
I do know that if I were to include the acDialog keyword to the DoCmd.OpenForm method that flow control would be paused while the edit form was open then I'd be able to requery the view/search form when it closes, however, the users have asked for a resizable edit dialog box and the acDialog keyword does not permit that.
I should also note that for reasons I have not been able to determine that the refresh method does not work for the recordsource of my view/search form. I have resorted to saving the primary key of the record, requerying the form and then navigating back to the record.
I'm really hoping that there's a simple way to do what I need to do.
Thanks in advance for any assistance you can provide.
I have a view/search form that users use to either find and edit an existing record by clicking an Edit This Record button OR add a new record by clicking an Add New record. When they click either button I open a form in either Edit or Add mode;
Edit;
Code:
DoCmd.OpenForm FrmNameEdit(frm), acNormal, "", "[DB_Key]=" & frm.txtDBKey, acEdit
Add;
Code:
DoCmd.OpenForm FrmNameEdit(frm), acNormal, "", "", acAdd
I've attached screenshots of the view/browse and edit forms so you can see what I'm working with.
Where I'm struggling is how to efficiently/reliably update the view/search form when the user is finished editing an exiting record or adding a new one.
There are a number of scenarios I need to handle;
- User doesn't make any changes. This is easy enough. Just close the edit form. Nothing to see here...
- User makes changes to the main form. I need to refresh the view/search form to display changes.
- User makes changes to either or both the main from and records in subforms. I may need to refresh the view/search form to display changes to the main form and also to the records in the subforms.
- User addes a new record. I need to navigate to the newly created record.
I do know that if I were to include the acDialog keyword to the DoCmd.OpenForm method that flow control would be paused while the edit form was open then I'd be able to requery the view/search form when it closes, however, the users have asked for a resizable edit dialog box and the acDialog keyword does not permit that.
I should also note that for reasons I have not been able to determine that the refresh method does not work for the recordsource of my view/search form. I have resorted to saving the primary key of the record, requerying the form and then navigating back to the record.
I'm really hoping that there's a simple way to do what I need to do.
Thanks in advance for any assistance you can provide.