Filter Syntax Question

NeroMaj

Registered User.
Local time
Today, 03:45
Joined
Sep 13, 2010
Messages
34
I want to filter values on a forms based on the ID in a query and the ID in a table. I think this should work, but it does not.

Dim strFilter as string

strFilter = "tblEAD.ID = qryACEA.ID"

Forms_frmEngineerHome.Filter = strFilter
Forms_frmEngineerHome.FilterOn = True

Do I need to do a DLookup() Function for the qryACEA.ID part, or is there another syntax to doing this.

I have predefined queries with ID column that is pulled from the primary key of the tblEAD.
 
Something like this seems more like it ...
Code:
Dim strFilter as string
strFilter = "ID = " & DLookup("ID", "qryACEA", SomeCriteria)
Forms!frmEngineerHome.Filter = strFilter
Forms!frmEngineerHome.FilterOn = True
 

Users who are viewing this thread

Back
Top Bottom