I am working on a geography database with Access 2K (DAO). It has a Form named ?GSAmaint? where in-country separately governed areas are defined and/or maintained (States, Territories, Provinces, etc.). Data is linked to a table named ?GSA? (for generic secondary areas) with ?saPK? (state abbreviation as its 4-character text Primary key).
The Forms data source is a query named ?qfSAmaint? and the Form (GSAmaint) uses fields from qfSAmaint to drive a list box named ?SelList?(for Selection List) used for record navigation in place of the data control. The ?saPK? field actually concatenates a 2-character country ID in front of a 2-character internal area ID to form its value easily allowing every country in the world to be added. The result produces 3885 separately administered areas within 264 countries (or territories) in the world.
Using the list box ?SelList? is a little slow (because there are 3885 records) unless I first use FindFirst to locate the first in-country area belonging to each country. To do that I placed a Combo box named ?QuickFind? that locates the first record containing the 2-character country ID and indexes focus to that record.
Private Sub QuickFind_AfterUpdate()
?INDEX TO THE SELECTED RECORD ANDRESET CURSOR FOCUS.
Dim rs As Object
Set rs = Me.Recordset.Clone
Rs.FindFirst ?[saFKca] = ?? & Me![QuickFind] & ???
Me.Bookmark = rs.Bookmark
saFKca.SetFocus
End Sub
saFKca is the Foreign Key to the Country ID (field within the GSAtable and qfSAmaint query) and the above code executes to set the Forms focus perfectly however the SelList selection list (also on my GSAmaint Form) does not respond. How do I synchronize SelList to reset focus based on the record being displayed after QuickFind_AfterUpdate() executes? The problem grows significantly once Secondary County, Parish City and Town areas are added at the next level.