Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture value of field w/focus, use value to open another form

Status
Not open for further replies.

mbannen

IS-IT--Management
Jan 1, 2004
12
US
I have two forms, each with sub forms.

The first form's subform is displayed as continuous forms and contains a value called 'folder_id'.

I want to enable the users to click on a folder_id and open another form/sub-form, displaying only records for the clicked-on folder_id.

The second form, the one to be opened, actually contains a sub-form within a sub-form. It is sub-sub-form that contains the folder_id.

WHAT I HAVE TRIED:
On the folder_id in the first firm, I tried doing a openform menu action on the double click event. I included a where condition in the macro. This will open the second form just fine, but does not open to and only to records matching the folder_id that was clicked.

DIRECTION OF THE SOLUTION?
I suspect I have to tell the macro which folder_id was clicked or has the focus (on the subform on form 1 there are many folder_ids displayed).

How to pass this to the macro, and how to apply it as a filter to a sub-sub form, I have no idea.

Help GREATLY appreciated.
 
Hi!

The where condition would reach the form you opened, not the subform within (without some "tweaking"). I think the easiest approach here, would be if you included a reference to your first subform in the other subforms query.

So - if the second subform is not based on a query - I'd recommend you to do it - and in the criteria row of the folder_id field, refer to the first subforms folder_id control (the syntax for that might be perseived as a bit awkward, but if you use the "Build" thingie, you'd manage) or the general syntax would be something like this:

[tt]Forms!NameOfParentForm!NameOfSubForm.Form!folder_id[/tt]

Substitute NameOfParentForm and NameOfSubForm with your form names. Should they contain spaces of special characthers, you'll need to put [brackets] around manually.

Then you could just use your open macro, but without the where condition.

HTH Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top