I have two forms - frmPersonDetails and frmHouseholds (Head of Household). I have a button set on frmPeople to open frmHouseholds. On frmPeople, I have PersonID, first name, last name, cell phone. If that person is also the HOH, I want to open frmHouseholds to add or edit address, phone #, and family information. In my button on frmPersonDetails, I have the code:
Code:
DoCmd.OpenForm "frmHouseholds", acNormal, "", "[HeadHouseholdID]=" & Me.intPersonID, , acDialog, intPersonID.Value
In my frmHouseholds form load event I have
Code:
If Me.OpenArgs <> vbNullString Then
intArgs = Me.OpenArgs
Me.cmbPersonID = intArgs
This works beautifully if the record already exists in the frmHouseholds. I want to be able to create a new record using the PersonID from the first form, if the record doesn't exist in frmHouseholds. What code do I need to add?
Please be patient with me. I'm just learning VBA.