C
Colin Foster
Hi Group,
I'm trying to use a checkbox ("UseAlt") to determine whether an alternative
contact is used in a form.
The main form contains contact details, with a subform showing alternatives
(having to do it this way as client has requested this add-on 12 months
after DB was designed!). So what I'm trying to do is set things up so that
if the "UseAlt" checkbox is selected, then the contact details from the
Alternatives subform (FrmAltContacts) are used. As there can be more than
one alternative contact, within the subform there is a checkbox ("active")
to indicate which, on this occasion, alternative contact is to be used.
I have come up with the following code attached to the LostFocus property of
the "UseAlt" checkbox.
Private Sub UseAlt_LostFocus()
If Me!UseAlt = -1 Then
WHERE [FrmAltContacts].Form![active]=-1
Me!saluation = [FrmAltContacts].Form![Salutation]
Me!ContactFirstName = [FrmAltContacts].Form![ContactFirstName]
Me!ContactLastName = [FrmAltContacts].Form![ContactLastName]
Me!ContactTitle = [FrmAltContacts].Form![ContactTitle]
End If
End Sub
Unfortunately, it doesn't work & having gone around in a few circles, I
thought that I'd seek assistance, here in the NG.
Any suggestions would be useful.
Regards
Colin Foster
I'm trying to use a checkbox ("UseAlt") to determine whether an alternative
contact is used in a form.
The main form contains contact details, with a subform showing alternatives
(having to do it this way as client has requested this add-on 12 months
after DB was designed!). So what I'm trying to do is set things up so that
if the "UseAlt" checkbox is selected, then the contact details from the
Alternatives subform (FrmAltContacts) are used. As there can be more than
one alternative contact, within the subform there is a checkbox ("active")
to indicate which, on this occasion, alternative contact is to be used.
I have come up with the following code attached to the LostFocus property of
the "UseAlt" checkbox.
Private Sub UseAlt_LostFocus()
If Me!UseAlt = -1 Then
WHERE [FrmAltContacts].Form![active]=-1
Me!saluation = [FrmAltContacts].Form![Salutation]
Me!ContactFirstName = [FrmAltContacts].Form![ContactFirstName]
Me!ContactLastName = [FrmAltContacts].Form![ContactLastName]
Me!ContactTitle = [FrmAltContacts].Form![ContactTitle]
End If
End Sub
Unfortunately, it doesn't work & having gone around in a few circles, I
thought that I'd seek assistance, here in the NG.
Any suggestions would be useful.
Regards
Colin Foster