Discussion Locked

List Box Synchronization using Access

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am working with Access 2000 (DAO)

On a form I have a field named ?saPK? and a list named ?SelList. There are to many records within SelList to effectively ?scroll? to my desired setting (6K +).

On the same form I have a combo box named ?QuikFind? that correctly indexes focus to the first ?saPK? within a set (states within a country) and loads saPK with the value needed to reset the focus within SelList. What code should I enter in the ?QuikFind? combo box?s After Update event to synchronize my forms list box focus to the same record the main form moves to?

QuickFind locates the Country first record ONLY and does not contain a ?saPK? value used to drive the list box. Once QuikFind executes however a populated saPK is availablethrough the same form (Me) to reset focus within SelList.

3 replies

by john_wills

I am not entirely sure of your question; you should distinguish "to" and "too", and there may be other things. However, if I understand you aright I have the same kind of problem: using a combobox on the client's major ethnicity I restrict the possibilities in the combobox on minor ethnicity, e.g. only an Hispano can be a Cuban. The minor-ethnicity table has a column for containing major ethnicity. The VB code in the major-ethnicity change is:
Private Sub Combo218_Change() ' Major Ethnicity 1
Dim CtlList As Control

Me.Combo229 = Null

' Return Control object pointing to list box.
Set CtlList = Me.Combo229 ' in Minor Ethnicity 1
' Requery source of data for list box.
CtlList.Requery
End Sub
The SQL for the Row Source of the minor ethnicity is:
SELECT MinorEthnicityType.Name, MinorEthnicityType.Description, MinorEthnicityType.MajorEthnicityID, MinorEthnicityType.ID
FROM MinorEthnicityType
WHERE (((MinorEthnicityType.MajorEthnicityID)=[Forms]![ClientInformation]![MajorEthnicityID1]))
ORDER BY MinorEthnicityType.Name;

This discussion is closed to new replies.