Filter question

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.
 
F

Fredg

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.
 

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