launch a new popup form from a subform

malcolm.reed

Registered User.
Local time
Today, 19:27
Joined
Jan 17, 2009
Messages
15
Hi
I'm hoping someone can help with this one because i feel I must be close!

I have a database for tracking repairs, returned by customers. Each return can consist of between 1 and 5 items, so I have 2 tables (RMA and items) with a 1 to many relationship. I've got other tables as well but I'll stick to the core problem. My main management form looks at Repairs one-by-one: on one tab I have an embedded subform showing the related items in datasheet layout. The datasheet is good for a summary but there's not enough space to see the whole picture of each item. So, I want to launch an "item details" pop-up form using the ID as a hyperlink, from the subform. This is the subform - the tabbed section is all part of the main form.

img1.png


I've researched this and found how to add an OnClick event to open a new form. I've added a line to the Where parameter using this sort of syntax:

[childID]=[Forms]![ParentForm]![ParentID]

In my case, that is:

[ID]=[Forms]![frm_items_split]![ID]

When I run this, I'm prompted to enter the ID number -

img2.png


If I enter 2, the new form pops up -

img3.png


Now, if I run the subform directly and bypass my main form, it works correctly without prompting for a value! So the problem is something to do with launching from the subform. I'm at the edge of my knowledge here, so can anyone suggest either what I'm doing wrong, or a different way to approach making the advanced view appear for my users?

Happy to post the db if anyone wants to take a close look and spot where I've gone astray!

Thanks
 
Try:
me.ID

The reason for your problem is that when you put a subform on a form, the subform has to be referenced as a control. You can't just reference it as if it were another form. Hence, when you run the subform as a standalone form it works fine.

You might also wish to look here for more information about referencing.

hth
Chris
 
Thanks Chris. After a few more attempts, I've ended up with

[ID]=[Forms]![frm_RMA001]![frm_items_split]![ID]

as my Where condition and that seems to be working. And that was a useful resource you pointed me to: going in my Bookmarks!

Malcolm
 

Users who are viewing this thread

Back
Top Bottom