Hi, I am new to access coding and need to figure out how to close parent forms when a subform is opened and retain the record that was on the parent form. This database will have many forms and since the users have older computers I don't want any additional forms open than are necessary. I have used wizards to create buttons that open the subform with the filtered record, however the parent forms stays open. Below is the coding for one of "these" buttons, I assume it would be a DoCmd.Close and the Form Name but that did not seem to work, I also tried creating my own macro with the a where statement but the child form comes up blank. Any help would be truly appreciated.
Thanks, Jennifer
Private Sub FindCustomerInformation_Click()
On Error GoTo Err_FindCustomerInformation_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CustomerInformation"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_FindCustomerInformation_Click:
Exit Sub
Err_FindCustomerInformation_Click:
MsgBox Err.Description
Resume Exit_FindCustomerInformation_Click
End Sub
Thanks, Jennifer
Private Sub FindCustomerInformation_Click()
On Error GoTo Err_FindCustomerInformation_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CustomerInformation"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_FindCustomerInformation_Click:
Exit Sub
Err_FindCustomerInformation_Click:
MsgBox Err.Description
Resume Exit_FindCustomerInformation_Click
End Sub