Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Subform Listing (Read 2354 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Subform Listing
Apr 7th, 2011 at 3:18pm
Print Post Print Post  
I'm not too familiar with subforms, so please explain carefully.

I know how to add and delete a subform record from the parent form. 

In a new applicaiton, I've set up a relational linkage as I expect many subrecords to be connected to one or more parent records.

When I add a new parent record, I want to list all the child records that match one element in the parent record.  I can get the subform list to appear after I've saved the parent record, but I want the subform list to appear while I'm adding the information in the parent record as I need to know some info from the subform list.  Can this be done?  Please explain how.

Thanks!

  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #1 - Apr 7th, 2011 at 3:42pm
Print Post Print Post  
NHUser wrote on Apr 7th, 2011 at 3:18pm:
I'm not too familiar with subforms, so please explain carefully.


This can be done, but would you mind if I ask you to explain the purpose of this setup more fully?

In general, when one sees a database which includes a many-to-many relationship (one parent may have many subrecords and one subrecord may have many parents), it's considered a red flag that there is something in the design that needs to be approached a different way.

If you don't want to hear about it, that's fine, but I'd feel irresponsible if I didn't mention it.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #2 - Apr 7th, 2011 at 4:41pm
Print Post Print Post  
My company manufactures rubber products.  We buy rubber in large batches of 500 pounds each.  We give the large batch a master "lot" number (Ex. 040711-1). 

To use the material, we take a small amound, say 50 pounds, and mix in the final ingredients.  When we do, we give it a new sub-lot number that is based on the master lot number (Ex. 040711-1-A).  Subsequent sub-lots will be given the next letter (Ex. 040711-1-B, 040711-1-C, etc)

We currently use a Sesame file to record the information about about each sub-lot number, for example, the mix date, customer part number, pounds used, etc.  We use a paper log book to keep track of how much of the master-lot material has been used and which letter should be assigned next.

I'm trying to move the paper log book onto Sesame.  So each time we mix a sub-lot of material the existing Sesame file would be able to look into the sub-file and see what the next letter to be used will be.  I also hope to have a report from the sub-file that would track the material inventory.

Hope this is clear.  If you can think of a better way to do it, let me know.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #3 - Apr 7th, 2011 at 5:42pm
Print Post Print Post  
OK. So, the master lot is the parent record and the sublots are the subrecords? If this is the case, how would any sublot have more than one parent lot?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #4 - Apr 7th, 2011 at 5:58pm
Print Post Print Post  
We create records in a Sesame file call Mill Log.  Each record is the information for the sub-lot of rubber.  This record would be the parent record (in Sesame parlance).  From this record I want to look at the sub-form Rubber Inventory that lists the parent lot number (EX. 040711-1) and all the sub-lot numbers that have been issued to date (Ex. 040711-1-A, 040711-1-B, etc).

After looking at the list of lot numbers, I would assign the next letter that is in line (Ex. 040711-1-F).  Then, the lot number I just assigned would be added to the sub-form inventory file as a new record. 

The next time I add a record to the to the Mill Log file, I can again look at the sub-form Rubber Inventory to see the list of all sub-lot numbers assigned (which would now include the 040711-1-F I just created).
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #5 - Apr 7th, 2011 at 6:03pm
Print Post Print Post  
So, would the parent record be 040711-1 or 040711-1-A?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #6 - Apr 7th, 2011 at 6:11pm
Print Post Print Post  
Both would be records in the Sesame file called Rubber Inventory.  The parent record would be in a different file called Mill Log.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #7 - Apr 7th, 2011 at 6:28pm
Print Post Print Post  
NHUser wrote on Apr 7th, 2011 at 6:11pm:
Both would be records in the Sesame file called Rubber Inventory.  The parent record would be in a different file called Mill Log.

Yes, but would the parent record in Mill Log be the one for 040711-1 or 040711-1-A?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #8 - Apr 7th, 2011 at 7:00pm
Print Post Print Post  
Each record in Mill Log would be a parent and would show all the records in the file Rubber Inventory.   I don't want a permanent connection between each parent in the Mill Log file, just a connection so I can see all the records in the Rubber Inventory file from each Mill Log file I create that uses the same master lot number.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #9 - Apr 7th, 2011 at 7:20pm
Print Post Print Post  
NHUser wrote on Apr 7th, 2011 at 7:00pm:
Each record in Mill Log would be a parent and would show all the records in the file Rubber Inventory.   I don't want a permanent connection between each parent in the Mill Log file, just a connection so I can see all the records in the Rubber Inventory file from each Mill Log file I create that uses the same master lot number.


It sounds like subrecords are an unnecessarily high impact way to get the information you need. I'd skip the whole subrecord thing and put a button on the "parent" form that displays the info you want in an unbound text editor or the WriteLn window.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #10 - Apr 7th, 2011 at 7:33pm
Print Post Print Post  
The more we chat, I think I agree with you.  But, besides just seeing the information, I want to add a record to the Rubber Inventory file (sub-form). 

Is there an easier way to do this?  Can I have a button to look for the data and then program it to add a record behind the scenes?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #11 - Apr 7th, 2011 at 7:40pm
Print Post Print Post  
NHUser wrote on Apr 7th, 2011 at 7:33pm:
The more we chat, I think I agree with you.  But, besides just seeing the information, I want to add a record to the Rubber Inventory file (sub-form).  

Is there an easier way to do this?  Can I have a button to look for the data and then program it to add a record behind the scenes?

Sure. Use the XResultSet commands.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Subform Listing
Reply #12 - Apr 7th, 2011 at 7:48pm
Print Post Print Post  
I've never used those before.  I'll go play with them for a while and see how they work.

Thanks for the suggestion.

  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Subform Listing
Reply #13 - Apr 7th, 2011 at 8:01pm
Print Post Print Post  
NHUser wrote on Apr 7th, 2011 at 7:48pm:
I've never used those before.  I'll go play with them for a while and see how they work.

Thanks for the suggestion.



You haven't tried them yet? Definitely do so.  You'll wonder how you ever lived without them.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Subform Listing
Reply #14 - Apr 8th, 2011 at 10:35pm
Print Post Print Post  
I just looked through this thread quickly, so I may have missed something, but it sounds like the easiest way to keep track of the next letter to be assigned is to add a field to the master record and every time a new sub batch is generated, just update that field in the master record.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print