Hello
I am working in Access 2007. I am trying to generate a report "Community_Records" that will only retrieve records that are associated with a specific community. For example when I select community ID “00001” all the records for all the communities are retrieved instead of the records that are only associated community ID “00001”. Listed below is the code I am using. What am I doing wrong? Your help will be greatly appreciated. Thank you. GMSRE
Private Sub cmdComRecords_Click()
Dim strFilter As String
strFilter = ""
strFilter = strFilter & " AND CommunityID = '" & Me.ComList & "'"
DoCmd.OpenReport "Community_Records", acViewPreview
End Sub
Private Sub ComList_AfterUpdate()
Me.ComList = Null
Me.ComList.Requery
Me.ComList = Me.Community.ItemData(0)
Me.FindRECID = Null
Me.FindRECID.Requery
Me.FindRECID = Me.Community.ItemData(0)
End Sub
Private Sub State_AfterUpdate()
Me.County = Null
Me.County.Requery
Me.County = Me.County.ItemData(0)
End Sub
Private Sub County_AfterUpdate()
Me.ComList = Null
Me.ComList.Requery
Me.ComList = Me.Community.ItemData(0)
End Sub
I am working in Access 2007. I am trying to generate a report "Community_Records" that will only retrieve records that are associated with a specific community. For example when I select community ID “00001” all the records for all the communities are retrieved instead of the records that are only associated community ID “00001”. Listed below is the code I am using. What am I doing wrong? Your help will be greatly appreciated. Thank you. GMSRE
Private Sub cmdComRecords_Click()
Dim strFilter As String
strFilter = ""
strFilter = strFilter & " AND CommunityID = '" & Me.ComList & "'"
DoCmd.OpenReport "Community_Records", acViewPreview
End Sub
Private Sub ComList_AfterUpdate()
Me.ComList = Null
Me.ComList.Requery
Me.ComList = Me.Community.ItemData(0)
Me.FindRECID = Null
Me.FindRECID.Requery
Me.FindRECID = Me.Community.ItemData(0)
End Sub
Private Sub State_AfterUpdate()
Me.County = Null
Me.County.Requery
Me.County = Me.County.ItemData(0)
End Sub
Private Sub County_AfterUpdate()
Me.ComList = Null
Me.ComList.Requery
Me.ComList = Me.Community.ItemData(0)
End Sub