Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down List does not populate other drop down list boxes

Status
Not open for further replies.

GMSRE

Technical User
Apr 14, 2011
1
US
Hi
I am working in Access 2007.
I have the related the state, county, and community tables. I also created an Input table to and a input form that is supposed to take the data from the state, county, and community tables. I have a combo box where you select a state. Listed below are the things I am looking for the database to do.
1. Select a state from the state drop down list to populate county list associated by state. Problem- Does not filter the counties in the county drop down comb box that are associated with the state.
2.Select a county from the county drop down list to populate community list associated by county and populate county ID number field. Problem-Does not filter the community in the community drop down comb box that are associated with the County. Does not populate the county ID field.
3.Populate automatically by county selected.Problem-County ID field does not populate.
4.Select a community from the community drop down list to populate community # field.Problem -Does not populate the community ID field.
5. Populate automatically by community selected. Problem-Community ID field does not populate.
6.Populate –string the state, county no, county, county number, community and community no fields.Problem- I only get the state in the description.

Below is macro code I got from another working database.
Private Sub cboFindCounty_AfterUpdate()
On Error Resume Next
Dim strFilter As String
If Not IsNull(Me.cboFindState) Then
strFilter = "CountyID = '" & Me.cboFindCounty & "'"
Me.Filter = strFilter
Me.FilterOn = True
End If
End Sub

Private Sub cboFindCounty_Enter()
On Error Resume Next
Me.cboFindCounty.Requery
End Sub

Private Sub cboFindState_AfterUpdate()
On Error Resume Next
Dim strFilter As String
If Not IsNull(Me.cboFindState) Then
strFilter = "cboFindCounty = '" & Me.cboFindState & "'"
Me.Filter = strFilter
Me.FilterOn = True
End If
End Sub

Private Sub cboFindState_Enter()
On Error Resume Next
Me.cboFindState.Requery
End Sub
Private Sub Form_Load()
Me.cboFindState.SetFocus
End Sub

I do not what I am doing wrong. Any help would be greatly appreciated.
Thank you.
Sincerely,

GMSRE


 
What is the SQL code of the RowSource of each combo ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top