Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 10th, 2004, 07:10 PM
Authorized User
 
Join Date: Nov 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to bjackman Send a message via MSN to bjackman
Default onclick event

I have run into a problem and i'm tired of beating my head against the wall. I have a form with one parent table and 2 subforms that complete it, i need to open the database filtered by one of the fields in the child table. The field is called PO number. The prblem i am having is the form opens and displays the records i want but the subform has 14 records in it so the parent form displays 14 recordss instead of the one parent record and the 14 children. Any help on this would be greatly appreciated.

 
Old July 12th, 2004, 08:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

What you have to do is open the MAIN form based on the PO Number, not the subform. If you open the main form this way, the subform parent/child relationship (if done correctly) will automatically show only the 14 children on the subform.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old July 13th, 2004, 01:27 PM
Authorized User
 
Join Date: Nov 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to bjackman Send a message via MSN to bjackman
Default

Well if i knew how to do that, i wouldn't have made this post. Can you enlighten me a little more about the method you described. The parent and child forms and tables are joined with one to many relationships. If there is any other information, please let me know because this is about to drive me nuts.

 
Old July 14th, 2004, 08:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by bjackman
 Well if i knew how to do that, i wouldn't have made this post.
 From your post, it sounded like you knew what you were doing but that you were having a problem because you were opening the child as the parent and the parent as the child. My post merely said to reverse it.

Open the MAIN form based on your PO number. Put your subforms in your new main form. Click on the subform and look at its Link Child Fields / Link Master Fields properties. In there, link the child PO Number field to the Master PO Number field.

When you open the main form (master), the subform (child) will filter automatically.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old July 14th, 2004, 09:12 AM
Authorized User
 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rather than discussing form components for a moment, I think that blackman has this type of problem:

He has an PO listing several part numbers of items purchased. He wants to click on the third or fourth item, for example, part number 123, and filter the PO forms to only show those Invoices that have part number 123 as a listed purchase.

Maybe I am reading it wrong, it is a bit confusing to understand.

Your move Blackman........
 
Old July 14th, 2004, 09:41 PM
Authorized User
 
Join Date: Nov 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to bjackman Send a message via MSN to bjackman
Default

OK Greg,

I am pretty good at this and don't ask for help often. I appreciate your input and i even started to try it. The only problem i have found with that is, that on the child form, there can be more than one po number for each parent record. This causes a problem right because with a single text box on the main form it has no weher to place the second po number. Does this make sense? If not, let me know and i'll try to provide additional information.

Branden:D

 
Old July 15th, 2004, 06:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Even if the parent has more than one PO number, if you navigate from the first to the second record on the main form, the subforms should change to match the correct PO number anyway as you scroll ahead/back. You don't need to put two PO numbers on one record.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid onclick event? hany ASP.NET 1.0 and 1.1 Professional 7 January 1st, 2006 05:21 AM
onclick event pigtail Javascript 1 April 11th, 2004 03:10 PM
onClick Event mateenmohd Javascript 4 December 16th, 2003 01:08 AM
onClick event problem mateenmohd Javascript 8 August 2nd, 2003 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.