PC Review


Reply
Thread Tools Rate Thread

Creating new row in other table

 
 
Maulwy
Guest
Posts: n/a
 
      7th Mar 2010
Dear All,

Please teach me, how to make a new row/list in other table by entering
number in other table. Sample, In the table A and in the field "Details", I
put the number 2 and it automatically creates two rows in table B. Can this
be done in MS Access? Thank you for your help.

Regards,
Maulwy
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      7th Mar 2010
Why? What business need are you attempting to solve with this approach?

It's generally considered not very good database design to be creating
'empty' rows in a second table. Why do you want empty rows?

And if the number you enter in TableA is a 'limit', why not just create new
rows in TableB (related, of course), until that limit is reached?

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Maulwy" <(E-Mail Removed)> wrote in message
news:4BF7BF82-5F23-4024-8871-(E-Mail Removed)...
> Dear All,
>
> Please teach me, how to make a new row/list in other table by entering
> number in other table. Sample, In the table A and in the field "Details",
> I
> put the number 2 and it automatically creates two rows in table B. Can
> this
> be done in MS Access? Thank you for your help.
>
> Regards,
> Maulwy



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      7th Mar 2010
On Sun, 7 Mar 2010 04:46:01 -0800, Maulwy <(E-Mail Removed)>
wrote:

>Dear All,
>
>Please teach me, how to make a new row/list in other table by entering
>number in other table. Sample, In the table A and in the field "Details", I
>put the number 2 and it automatically creates two rows in table B. Can this
>be done in MS Access? Thank you for your help.
>
>Regards,
>Maulwy


As Jeff says, it's very rarely either necessary nor a good idea to create
empty "placeholder" records in a table. They have an unpleasant habit of never
getting filled in.

The normal way to do this is to use a Form based on TableA, with a Subform
based on TableB, using the subform's Master/Child Link Field properties to
link them. When you enter data into the form and then the subform, Access will
automatically fill in the link, *when it is needed* and not before.

If you have some special need to do it the other way please explain.
--

John W. Vinson [MVP]
 
Reply With Quote
 
Maulwy
Guest
Posts: n/a
 
      8th Mar 2010

Dear Jeff & John,

For example, if we do a sales order, where there is a column for the model,
quantity and serial number. To model and quantity, comes from one table,
while for the serial number, which I want, be inputted in the other table.
But not all existing models, has a serial number, this is the basic one, the
serial number I did not join in a single table. To avoid input mistakes
serial number, if the quantity, I suppose input 2, then automatically, the
database will add the 2 lines at the next table (the serial number tables).
Database like this is what I mean. Example data:
Model TransID Qty
1 AAA 2
2 BBB 3

TransID SerialNumber
1 AAAXXX01
1 AAAXXX02
2 BBBXXX01
2 BBBXXX50
2 BBBXXX65

Rgds,
Maulwy

"John W. Vinson" wrote:

> On Sun, 7 Mar 2010 04:46:01 -0800, Maulwy <(E-Mail Removed)>
> wrote:
>
> >Dear All,
> >
> >Please teach me, how to make a new row/list in other table by entering
> >number in other table. Sample, In the table A and in the field "Details", I
> >put the number 2 and it automatically creates two rows in table B. Can this
> >be done in MS Access? Thank you for your help.
> >
> >Regards,
> >Maulwy

>
> As Jeff says, it's very rarely either necessary nor a good idea to create
> empty "placeholder" records in a table. They have an unpleasant habit of never
> getting filled in.
>
> The normal way to do this is to use a Form based on TableA, with a Subform
> based on TableB, using the subform's Master/Child Link Field properties to
> link them. When you enter data into the form and then the subform, Access will
> automatically fill in the link, *when it is needed* and not before.
>
> If you have some special need to do it the other way please explain.
> --
>
> John W. Vinson [MVP]
> .
>

 
Reply With Quote
 
Maulwy
Guest
Posts: n/a
 
      8th Mar 2010
Dear All,

Sorry, the example should be:

TransID Model Qty
1 AAA 2
2 BBB 3

TransID SerialNumber
1 AAAXXX01
1 AAAXXX02
2 BBBXXX01
2 BBBXXX50
2 BBBXXX65 (null?)

Many Thanks,
Maulwy

"Maulwy" wrote:

>
> Dear Jeff & John,
>
> For example, if we do a sales order, where there is a column for the model,
> quantity and serial number. To model and quantity, comes from one table,
> while for the serial number, which I want, be inputted in the other table.
> But not all existing models, has a serial number, this is the basic one, the
> serial number I did not join in a single table. To avoid input mistakes
> serial number, if the quantity, I suppose input 2, then automatically, the
> database will add the 2 lines at the next table (the serial number tables).
> Database like this is what I mean. Example data:
> Model TransID Qty
> 1 AAA 2
> 2 BBB 3
>
> TransID SerialNumber
> 1 AAAXXX01
> 1 AAAXXX02
> 2 BBBXXX01
> 2 BBBXXX50
> 2 BBBXXX65
>
> Rgds,
> Maulwy
>
> "John W. Vinson" wrote:
>
> > On Sun, 7 Mar 2010 04:46:01 -0800, Maulwy <(E-Mail Removed)>
> > wrote:
> >
> > >Dear All,
> > >
> > >Please teach me, how to make a new row/list in other table by entering
> > >number in other table. Sample, In the table A and in the field "Details", I
> > >put the number 2 and it automatically creates two rows in table B. Can this
> > >be done in MS Access? Thank you for your help.
> > >
> > >Regards,
> > >Maulwy

> >
> > As Jeff says, it's very rarely either necessary nor a good idea to create
> > empty "placeholder" records in a table. They have an unpleasant habit of never
> > getting filled in.
> >
> > The normal way to do this is to use a Form based on TableA, with a Subform
> > based on TableB, using the subform's Master/Child Link Field properties to
> > link them. When you enter data into the form and then the subform, Access will
> > automatically fill in the link, *when it is needed* and not before.
> >
> > If you have some special need to do it the other way please explain.
> > --
> >
> > John W. Vinson [MVP]
> > .
> >

 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      8th Mar 2010
Why not use a form instead of table A? Where will the query get the serial
numbers to use in table B?

--
Build a little, test a little.


"Maulwy" wrote:

> Dear All,
>
> Sorry, the example should be:
>
> TransID Model Qty
> 1 AAA 2
> 2 BBB 3
>
> TransID SerialNumber
> 1 AAAXXX01
> 1 AAAXXX02
> 2 BBBXXX01
> 2 BBBXXX50
> 2 BBBXXX65 (null?)
>
> Many Thanks,
> Maulwy
>
> "Maulwy" wrote:
>
> >
> > Dear Jeff & John,
> >
> > For example, if we do a sales order, where there is a column for the model,
> > quantity and serial number. To model and quantity, comes from one table,
> > while for the serial number, which I want, be inputted in the other table.
> > But not all existing models, has a serial number, this is the basic one, the
> > serial number I did not join in a single table. To avoid input mistakes
> > serial number, if the quantity, I suppose input 2, then automatically, the
> > database will add the 2 lines at the next table (the serial number tables).
> > Database like this is what I mean. Example data:
> > Model TransID Qty
> > 1 AAA 2
> > 2 BBB 3
> >
> > TransID SerialNumber
> > 1 AAAXXX01
> > 1 AAAXXX02
> > 2 BBBXXX01
> > 2 BBBXXX50
> > 2 BBBXXX65
> >
> > Rgds,
> > Maulwy
> >
> > "John W. Vinson" wrote:
> >
> > > On Sun, 7 Mar 2010 04:46:01 -0800, Maulwy <(E-Mail Removed)>
> > > wrote:
> > >
> > > >Dear All,
> > > >
> > > >Please teach me, how to make a new row/list in other table by entering
> > > >number in other table. Sample, In the table A and in the field "Details", I
> > > >put the number 2 and it automatically creates two rows in table B. Can this
> > > >be done in MS Access? Thank you for your help.
> > > >
> > > >Regards,
> > > >Maulwy
> > >
> > > As Jeff says, it's very rarely either necessary nor a good idea to create
> > > empty "placeholder" records in a table. They have an unpleasant habit of never
> > > getting filled in.
> > >
> > > The normal way to do this is to use a Form based on TableA, with a Subform
> > > based on TableB, using the subform's Master/Child Link Field properties to
> > > link them. When you enter data into the form and then the subform, Access will
> > > automatically fill in the link, *when it is needed* and not before.
> > >
> > > If you have some special need to do it the other way please explain.
> > > --
> > >
> > > John W. Vinson [MVP]
> > > .
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko Microsoft Excel Misc 0 5th May 2010 12:21 AM
Creating a registration table list based on an existing table ChuckW Microsoft Access Forms 3 16th Dec 2007 12:35 PM
Creating a registration table list based on an existing table ChuckW Microsoft Access Queries 0 12th Dec 2007 04:13 PM
Creating a table from a recordset query then having a report form use the resulting table. LordHog@hotmail.com Microsoft Access 0 18th Oct 2005 07:00 PM
Automatically creating records in one table based on values in another table wslayton Microsoft Access Database Table Design 1 1st Nov 2003 08:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:26 AM.