EternalMyrtle
I'm still alive
- Local time
- Yesterday, 16:19
- Joined
- May 10, 2013
- Messages
- 533
I am a little bit lost here. I have a SpouseID field in my Contacts table to link spouses.
When a spouse is selected in one contact's record, I want to be able to automatically update the other contact's SpouseID control.
I have created a calculated control called txtSpouseID that uses DLookup to find the ContactID for the other spouse:
=Nz(DLookUp("[ContactID]","tblContacts","[Spouse] =" & [ContactID]))
And I have entered this code into the form's OnCurrent event:
However, this obviously only works if the user navigates to the spouses record. If s/he doesn't then the value does not get entered into the table.
Is there some way to do this that I don't know of??
When a spouse is selected in one contact's record, I want to be able to automatically update the other contact's SpouseID control.
I have created a calculated control called txtSpouseID that uses DLookup to find the ContactID for the other spouse:
=Nz(DLookUp("[ContactID]","tblContacts","[Spouse] =" & [ContactID]))
And I have entered this code into the form's OnCurrent event:
Code:
If Not IsNull(Me.txtSpouseID) Then
Me.Spouse = Me.txtSpouseID
End If
However, this obviously only works if the user navigates to the spouses record. If s/he doesn't then the value does not get entered into the table.
Is there some way to do this that I don't know of??