Refreshing fields in a form based on a ComboBox

mba1942

Registered User.
Local time
Today, 07:53
Joined
Apr 5, 2012
Messages
16
I have a [Visits] form where our clients can log in their visit when they come into our office.

Our clients are assigned to a Branch which is assigned to a parent District.

There are many Branches in a District and many Districts.

At times our clients remember their Branch number [BranchNo] but do not remember their District number [DistrictNo].

I have created a query wherein the various Branches are shown with their assigned District. This query forms the base for my [Combo52] ComboBox.

Once selected, I move the Branch information and District Information from the [Combo52] ComboBox to their respective fields in the form: BranchNo and DistrictNo.

eg: BranchNo.Value = Me.Combo52 and
DistrictNo.Value = Me.Combo52.Column(3)

This works well on the first pass. ... The BranchNo and DistrictNo show on the form with their selected values.

However if the client changes his mind vis-a-vis his Branch Number and goes back to the [Combo52] ComboBox, for a second or n-th time, the selections are updated in the Combo52 combobox but the form fields: BranchNo and DistrictNo are not refreshed until I actually click on them in the form.

What can I do do to show these refreshed fields similar to the first time a selection is made?

Thank you so much for your help! MBA
 
You should NOT be storing all of this data again. If it is in the lookup table, all you need is to store the branch ID as the district can be pulled based on that ID.

And to change the display, if the control sources of the controls which would DISPLAY the branch name and district name are set to something like:

for district
=[Combo52].[Column](3)

it will display immediately upon the change of the combo. It won't store that data (which is what it should be doing - not storing it) but it will display it.
 
Thank you so much for your response!

I have taken over this program from others and the transition from 'old' to 'new' will take a little time. Thus I am keeping some of the old with the new for now.

In reality, the BranchNo and DistrictNo fields are, in themselves, Combo Box fields which in the past have been selected independently. The client needed to know both in order to procede.

I just resolved the issue for the present by using the .SetFocus property for the existing cmbBranchNo and cmbDistrictNo in order to to pass through them both on the way to the next required field, which is also a combo box.

Me.cmbBranchNo.SetFocus
Me.cmbDistrict.SetFocus
Me.cmbNextField.SetFocus

Again thank you for you very quick response!
MBA
 

Users who are viewing this thread

Back
Top Bottom