JS-Q8: Selecting reconrds in a form

J

Jack Sheet

Hi all

I have a simple form for editing records in a table. All of the boxes are
text boxes except for one which is a Combo box. The Combo box is used as an
alternative method for selecting the record to be edited (contrasted with
using the arrow-bar at the foot of the form). The Combo box is used to
select a reference that defines the record and is not itself editable,
although all of the other (text) boxes are editable to amend their
respective fields on the form.

Problem:
If I choose to use the arrows at the foot of the form to select (eg) the
next/previous record adjacent to the record currently selected, then I want
the field in the combo box to update automatically so that it shows the
reference field of the newly selected record (currently it does not change
at all).
How do I go about this, please?

Thanks, and please ignore character string JS-Q8 in subject header.
 
A

Al Camp

Jack,
It sounds as though you're using a combo to "jump" to a particular record
for editing, and when you button "navigate" from record to record the value
in the combo stays the same as the last jump.
I don't see why it's necessary to keep the search combo in "synch" with
the reference value. The reference value itself should be displayed in it's
own field on the form... editable or not. (ex. a CustomerID)
I'd just Null out the combo using the OnCurrent event of the form. That
way, when you "navigate" to another record, the CustomerID is displayed on
the form, and the combo is blank... ready for another "jump" when needed.

If you must "synch" the combo during navigation, use the form OnCurrent
event to set the value of the combo to that particular CustomerID.

Private Sub Form_Current()
cboYourComboName = CustomerID
End Sub

Of course, your combobox must contain all possible CustomerIDs if
LimitToList is true.
 
J

Jack Sheet

Thank you Al Camp. You understood my problem accurately and the solution is
fine.
 

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