I have a main form with buttons that do a simple "Open Form" operation to open the desired form. What I would like to do in that process would be to write some sort of function or module that can close the form that was just clicked away from.
Say, for example, FORM A is the "home form." On that, there are command buttons that link to other forms, FORM B and FORM C that perform separate operations. On forms B and C, there is a link back to the "home form," FORM A, and I would like to close FORM B or C upon going back to FORM A. I don't know if someone knows how to do this, but it seems logical in my mind. Any help anyone can offer would be greatly appreciated! Thanks much!
Some options here depending on what type of Forms you are using. Are they set as Dialog forms? Anyway this is pretty straightforward using a standard CLOSE button on Form B or Form C as you call them. You will need to make Form A not visible if you wish to view Form B and then make A visible again when B closes. Use vb like Forms!FormA.Visible = False on opening B and then set to Forms!FormA.Visible = True onclosing B.
Alternatively set Form properties POP UP, MODAL to Yes and BORDER STYLE to Dialog and use standard CLOSE buttons.
Hope this helps. Get back to me if you still are in difficulty. Nice week-end