R
Rick
A form has three combo boxes on it as follows:
ClientType
CorporateID
ContactID
The choices for the ClientType combo are "Corporate"
or "Contact"
An unbound text box named CorporateName on the same form
contains this formula:
=CorporateID.column(2) & " " & CorporateID.column(3)
Another unbound text box named ContactName on the same
form contains the following formula:
=ContactID.column(5) & " " & ContactID.column(4)
The entry in ClientType on focus event determines which
combo box (either CorporateId or Contact ID) and which
text box (either CorporateName or ContactName) are
visible.
For example:
If ClientType = "Corporate" Then
Me.ContactID.Visible = False
Me.ContactName.Visible = False
Me.CorporateID.Visible = True
Me.CorporateName.Visible = True
Else
Me.ContactID.Visible = True
Me.ContactName.Visible = True
Me.CorporateID.Visible = False
Me.CorporateName.Visible = False
End If
Problem is the calculated controls CorporateName or
ContactName are blank when the form is opened or when the
user moves to the next record.
It is only when the cursor moves across the ClientType
control that the CorporateName or ContactName controls
are refreshed.
I have tried events to RepaintObject; Requery; etc. on
the form open or gotfocus and on the ClientType control's
gotfocus event. Nothing seems to work.
ClientType
CorporateID
ContactID
The choices for the ClientType combo are "Corporate"
or "Contact"
An unbound text box named CorporateName on the same form
contains this formula:
=CorporateID.column(2) & " " & CorporateID.column(3)
Another unbound text box named ContactName on the same
form contains the following formula:
=ContactID.column(5) & " " & ContactID.column(4)
The entry in ClientType on focus event determines which
combo box (either CorporateId or Contact ID) and which
text box (either CorporateName or ContactName) are
visible.
For example:
If ClientType = "Corporate" Then
Me.ContactID.Visible = False
Me.ContactName.Visible = False
Me.CorporateID.Visible = True
Me.CorporateName.Visible = True
Else
Me.ContactID.Visible = True
Me.ContactName.Visible = True
Me.CorporateID.Visible = False
Me.CorporateName.Visible = False
End If
Problem is the calculated controls CorporateName or
ContactName are blank when the form is opened or when the
user moves to the next record.
It is only when the cursor moves across the ClientType
control that the CorporateName or ContactName controls
are refreshed.
I have tried events to RepaintObject; Requery; etc. on
the form open or gotfocus and on the ClientType control's
gotfocus event. Nothing seems to work.