Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 10th, 2004, 07:10 PM
Authorized User
 
Join Date: Nov 2003
Location: Hillsboro, Ohio, USA.
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.

Reply With Quote
  #2 (permalink)  
Old July 12th, 2004, 08:22 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #3 (permalink)  
Old July 13th, 2004, 01:27 PM
Authorized User
 
Join Date: Nov 2003
Location: Hillsboro, Ohio, USA.
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.

Reply With Quote
  #4 (permalink)  
Old July 14th, 2004, 08:31 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #5 (permalink)  
Old July 14th, 2004, 09:12 AM
Authorized User
 
Join Date: May 2004
Location: , NH, USA.
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........
Reply With Quote
  #6 (permalink)  
Old July 14th, 2004, 09:41 PM
Authorized User
 
Join Date: Nov 2003
Location: Hillsboro, Ohio, USA.
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

Reply With Quote
  #7 (permalink)  
Old July 15th, 2004, 06:54 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.