Open new form to specific record

jsic1210

Registered User.
Local time
Yesterday, 23:40
Joined
Feb 29, 2012
Messages
188
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"
 
You have to Save the new Contract Record first:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "frmContractForm", , , "COID=" & Me.COID
DoCmd.Close acForm, "frmContractAffiliateForm"

Linq ;0)>
 
I thought I had tried that, but apparently not because it worked this time.
Thanks!
 

Users who are viewing this thread

Back
Top Bottom