I have two related forms: 1. frmContractForm (parent derived from tblCustomer) with the subform frmContractSub (derived from tblContract) and 2. frmAffiliateForm (parent derived from tblContract) with the subform frmAffiliateSub. I have a button on the subform of frmContractForm that I want to open frmAffiliateForm where ContractID is the same. It works sometimes, but if I have just created that contract, it will open frmAffiliateForm and show "(New)" for ContractID. How can I open frmAffiliateForm and have ContractID show the same as frmContractForm? Here is my code:
'Open Contract
DoCmd.OpenForm "frmContractForm", , , "COID=" & Me.COID
DoCmd.Close acForm, "frmContractAffiliateForm"
'Open Contract
DoCmd.OpenForm "frmContractForm", , , "COID=" & Me.COID
DoCmd.Close acForm, "frmContractAffiliateForm"