Hello!
I apologize that I may not be using the right terminology here, but this is my situation. For some controls, DoCmd.OpenForm will open the requested form and immediately switch the view to the tab containing the form. On other controls, the view will remain on the display form. I can't figure out why. My DB display form has these controls:
The Add New Item / Edit Item / Add New Person / Edit Person controls operate as intended. This is the code that operates them (using Add New Item button as example):
The problem is when I open forms from other windows. If the user searches for an item or person in either of the two search boxes, AfterUpdate brings up a a pop-up form ([frmSearchSelectItem] and [frmSearchSelectPerson]) that displays all the matches for their search. Each match is a hyperlink that uses this code
The code opens the desired form, but when the popup form closes, the view defaults back to the display form, and the user has to click the appropriate tab to access the form that just opened. I have tried removing the DoCmd.Close line from the code, and interestingly, the opened form is visible behind the popup, but as soon as I close the popup (either with the X button or the cancel button I put on the popup), the view switches back to the display form. Is there a way to get the just-opened form to remain in view when the popup closes?
I'm designing this to be as easy to use as possible; the employees that will eventually use this database have no experience whatsoever with this kind of software, and I won't be working here anymore to help them.
I apologize that I may not be using the right terminology here, but this is my situation. For some controls, DoCmd.OpenForm will open the requested form and immediately switch the view to the tab containing the form. On other controls, the view will remain on the display form. I can't figure out why. My DB display form has these controls:
The Add New Item / Edit Item / Add New Person / Edit Person controls operate as intended. This is the code that operates them (using Add New Item button as example):
Code:
Private Sub CmdOpenAddNewItem_Click()
DoCmd.OpenForm "AddNewItem", acNormal, , , acFormAdd, acWindowNormal
End Sub
The problem is when I open forms from other windows. If the user searches for an item or person in either of the two search boxes, AfterUpdate brings up a a pop-up form ([frmSearchSelectItem] and [frmSearchSelectPerson]) that displays all the matches for their search. Each match is a hyperlink that uses this code
Code:
PrivateSub ItemName_Click()
DoCmd.OpenForm "frmViewItem", acNormal, "", "[ItemID]=[Forms]![frmSearchSelectItem]![ItemID]", acFormReadOnly, acWindowNormal
DoCmd.Close acForm, "frmSearchSelectItem"
End Sub
The code opens the desired form, but when the popup form closes, the view defaults back to the display form, and the user has to click the appropriate tab to access the form that just opened. I have tried removing the DoCmd.Close line from the code, and interestingly, the opened form is visible behind the popup, but as soon as I close the popup (either with the X button or the cancel button I put on the popup), the view switches back to the display form. Is there a way to get the just-opened form to remain in view when the popup closes?
I'm designing this to be as easy to use as possible; the employees that will eventually use this database have no experience whatsoever with this kind of software, and I won't be working here anymore to help them.