Display result of calculated control

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 (the result of the calculated controls are
displayed)

If a SetFocus is run on each calculated control the data
appears correctly.

Is this solution the correct one to display the results
of the calculated controls or is there a better way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top