Form filtering question

  • Thread starter Thread starter JB
  • Start date Start date
J

JB

I have a form open, Form A, that uses a filter to open another form,
Form B. In order to open Form B and properly filter the records, I need
two IDs. One ID I can get from Form A. My problem is how do I know what
the second ID needs to be. I have another hidden form open, Form C that
contains the list of possible IDs to choose from, but how do I use code
to accurately figure out which ID on Form C to use with the filter to
open Form B?

If I only use the ID from Form A then Form B shows me more data than is
appropriate. It would be the most accurate to use the ID from Form A
and the ID from Form C that was used to originally create the record.
Since Form C may have many values I can not figure out how to determine
which ID matches. Should I do some sort of Dlookup with the recordset
after Filtering with the ID from Form A? Would that make things slow?
The returned recordset would probably be small.

I have been fumbling with this for two days now and am completely
unsure of what else to try.
 
I have a form open, Form A, that uses a filter to open another form,
Form B. In order to open Form B and properly filter the records, I need
two IDs. One ID I can get from Form A. My problem is how do I know what
the second ID needs to be. I have another hidden form open, Form C that
contains the list of possible IDs to choose from, but how do I use code
to accurately figure out which ID on Form C to use with the filter to
open Form B?

How do the IDs on FormC relate to the ID chosen on FormA? You can use a DLookup or Recordset to get this information,
but how do you know which one to choose?

For example, if I choose ID# 12345 on FormA, how would I use that information to determine which ID from FormC to get?
If I only use the ID from Form A then Form B shows me more data than is
appropriate. It would be the most accurate to use the ID from Form A
and the ID from Form C that was used to originally create the record.
Since Form C may have many values I can not figure out how to determine
which ID matches. Should I do some sort of Dlookup with the recordset
after Filtering with the ID from Form A? Would that make things slow?
The returned recordset would probably be small.

The Domain functions (DMax, DLookup) are typically much slower than opening a recordset.
I have been fumbling with this for two days now and am completely
unsure of what else to try.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

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

Back
Top