By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,017 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,017 IT Pros & Developers. It's quick & easy.

Is it possible to open a search from from another form, pre-filtering the data...

P: 38
*above I meant to say 'search form, from'
I am wondering if it is possible to open a search form from another form (onclick of any record in a text box), pre-filtering the data in the search to relate to the originally clicked record... ie.
At the moment I am implementing a code library, the two main forms are frm001_CodeSearch which enables the user to filter what code they can see. The second is frm002_Categories which consists of categories which the different code samples come under. On the click of a category I want frm001_CodeSearch to open and be pre-filtered, showing only code under that category.

Is this possible?

Any replies and pointers in the right direction are appreciated!

Cheers,
Rebecca
Aug 31 '10 #1
Share this Question
Share on Google+
5 Replies


Oralloy
Expert 100+
P: 983
Yes, it is.

Open the form, and then set the [Record Source] or [Filter] attribute.
Aug 31 '10 #2

P: 38
frm002 already has a record source, as does frm001
Which form should the filter attribute be set on and what to exactly?

Thanks for the reply

Rebecca
Sep 1 '10 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
Hi Rebecca.
Assumming that each code is assigned to a category by a field ID_Category and that field is a number field you could do such:

Expand|Select|Wrap|Line Numbers
  1. docmd.openform "frm001_CodeSearch ",,,"ID_Category=" & me.tb_Category
where tb_Category shall be a textbox (or combobox) on your frm_002, containing the ID_Category.

I dont know your level of code expertise, so if you require more assistance, please feel free to ask for it.
Sep 1 '10 #4

P: 38
Thanks for your help but I've managed to do it in a different way now, by controlling the filter on the other form instead.

Thanks anyway!

Rebecca
Sep 1 '10 #5

Oralloy
Expert 100+
P: 983
Just got in and I saw the continued thread.

Glad you figured it out, Rebecca.

Cheers!
Sep 1 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.