Jul 27 2004, 04:04 PM
Say I have 3 forms open...I want to close the form that is in the front...or the one that has focus.
I want it to be used on any form, so I don't want the code to include the form name.
Jul 27 2004, 04:26 PM
I think you can refer to the active form with
Docmd.Close acForm, Screen.ActiveForm
The only trick is going to be where you call this code from. I would create a Public function in a standard code module and call it from anywhere that is neccessary.
Jul 27 2004, 04:32 PM
I am using it on a menu bar...
Jul 27 2004, 05:33 PM
I want a form that has a tree view on it...already created that. The treeview has a main category "Patient Information", then sub categories "Demographics", "Test Results".
What I would like to happen is to have the SAME form change to whatever the users chooses. So if the user is in "frmPatientInformation" and has chosen "Demographics" from the tree view the patients demographics would show up...then they click "Test Results" and I want the test results for the patient to show up...BUT without opening new forms on top....does this make any sense?
Jul 27 2004, 06:30 PM
In the on-click event of your command button you can start with the statement me.visible = false. If there is a chance the user will go back to the form later, it is better to leave it open but not visible. Then when the user clicks a button on another form to return to the first one, just specify that it should be viisble again. That saves loading time between forms.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here