Filter question

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

Hi,
How do I 'access' the value of a form's filter so I can lookup a value using
Expression Builder?

eg:

I have a form called "Product Configs" which sets a filter: "ProductID =
28'. How then can I use this filter value to say DLookup a txtProductName
based on this value?

Thanks alot. matthew.
 
Matthew,

=DLookUp("[txtProductName]","TableName","[ProductID = 28")
Notice the 28 is 'hard coded' above.

If the form is displaying the [ProductID] field, and you wish to use the ID
number currently shown, then you can change the expression to:

=DLookUp("[txtProductName]","Tablename","[ProductID = " & Me![ProductID])

assuming [ProductID] is a number datatype.

Note also that it is the Table that is looked in, not the form.
 
Back
Top