I'm new to this. I have created a navigation form with 3 tabs. when I click on one tab it opens a pop-up form where I chose a record from a drop-down. when I click on a command button to "open file" I want the form to open in the tabs 'sub-form window'. at the moment all it does is opens in a separate window.
how do I get the form to open in the navigation sub-form window where it is linked, with the correct information in the fields based on the combo box?
Private Sub Amend_record_Click()
On Error GoTo Err_Amend_record_Click
Dim stDocName As String
Dim stLinkCriteria As String
vFormName = Screen.ActiveForm.Name
stDocName = "invoice_amend"
vtest = Me![Combo0]
stLinkCriteria = "[InvoiceID]=" & Me![Combo0]
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, , stLinkCriteria
Forms![navigation_form]!NavigationButton18.SetFocus
DoCmd.Close acForm, vFormName
Exit_Amend_record_Click:
Exit Sub
Err_Amend_record_Click:
MsgBox Err.Description
Resume Exit_Amend_record_Click
End Sub
DoCmd.OpenForm stDocName...
means that you're opening a new form. Instead you want to show this as a sub-form in the tab you started from, right? So you need a sub-form control in that tab, you set the Source Object of that sub-form control to the form which needs displaying, and put your filter on that. – user3728595