Filtering a Form based on a Subform field

  • Thread starter Marie via AccessMonster.com
  • Start date
M

Marie via AccessMonster.com

Am using Allen Browne's "Filter a Form on a Field in a Subform" article to
enable me to filter a Main Form (frmEntity) using the AfterUpdate event of
the cboShowStore combo box. The combo box is based on the dbo_Stores table.
Please see code below.

Dim strSQL As String
If IsNull(Me.cboShowStore) Then
Me.RecordSource = "dbo_Entities"
Else
strSQL = "SELECT DISTINCTROW dbo_Entities.* FROM dbo_Entities INNER JOIN
EntitiesStores ON dbo_Entities.Entity = EntitiesStores.Entity WHERE
EntitiesStores.Store = ' Me.cboShowStore '"
Me.RecordSource = strSQL
End If
End Sub

When I select a store from the drop down list, all information on the Entity
form is removed.

I tried creating a query with the same logic and it returned the appropriate
record.
I must be missing something

Thanks in advance for your help,
Marie
 

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