A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating Sub Item in Access



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 07:28 PM posted to microsoft.public.access
Maulwy
external usenet poster
 
Posts: 22
Default Creating Sub Item in Access

Dear All,

I have a table A, which consists of the field "ID" and "QTY", and Table B,
which consists of "ID2" and "Details". "ID" is AutoNumber. At the time of the
input data using a form field "QTY" to number 2, then automatically, on the
table B, increased 2 lines, where the field "ID2" contains the number "001-1"
and "001-2", where "001" comes from "ID" and "-1" and "-2" comes from "QTY" =
2. If the next record, in the "QTY" I input 3, then the "ID2" = "002-1",
"002-2", 002-3 ".
The question is, how do I make this in Access?
Thank you in advance.

Rgds,
Maulwy
  #2  
Old March 18th, 2010, 08:14 PM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Creating Sub Item in Access

First off, you probably wouldn't need to ...

The notion of a relational database is that you can put records in your
tableB that are related to records in your tableA. You would have a field
in tableB to hold a "foreign key" (check Access HELP if this term is
unfamiliar) that points back to the ID from tableA that "owns" the record in
tableB.

If you are trying to introduce formatting like "001-1", "001-2", etc., use a
query to join the tables and display values from those two tables to look
like that.

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" wrote in message
...
Dear All,

I have a table A, which consists of the field "ID" and "QTY", and Table B,
which consists of "ID2" and "Details". "ID" is AutoNumber. At the time of
the
input data using a form field "QTY" to number 2, then automatically, on
the
table B, increased 2 lines, where the field "ID2" contains the number
"001-1"
and "001-2", where "001" comes from "ID" and "-1" and "-2" comes from
"QTY" =
2. If the next record, in the "QTY" I input 3, then the "ID2" = "002-1",
"002-2", 002-3 ".
The question is, how do I make this in Access?
Thank you in advance.

Rgds,
Maulwy



  #3  
Old March 18th, 2010, 09:58 PM posted to microsoft.public.access
Maulwy
external usenet poster
 
Posts: 22
Default Creating Sub Item in Access

Dear Jeff,

Basically, my desire is the existence of a function that limits the number
of rows in Table B based on the amount that has been input in table A.
Examples of cases, delivery order transactions, in the master transaction
(Table A), has been input 2 goal posts. If this transaction commits,
automatically, the program adds 2 new lines in Table B, which will be used to
fill the delivery destination address. So, what will be input in Table A,
will limit the number of rows in Table B. When I use a sub form, it can not
restrict it. What I want, Table B is a detail of Table A, where the number of
rows in Table B, depending on what the inputs in table A, so that users can
not be input to more / less than what has been input in Table A . Almost the
same as the sub form, only the number of rows in the sub form, depending on
the amount that has been input in Table A.
Thank you in advance.

"Jeff Boyce" wrote:

First off, you probably wouldn't need to ...

The notion of a relational database is that you can put records in your
tableB that are related to records in your tableA. You would have a field
in tableB to hold a "foreign key" (check Access HELP if this term is
unfamiliar) that points back to the ID from tableA that "owns" the record in
tableB.

If you are trying to introduce formatting like "001-1", "001-2", etc., use a
query to join the tables and display values from those two tables to look
like that.

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" wrote in message
...
Dear All,

I have a table A, which consists of the field "ID" and "QTY", and Table B,
which consists of "ID2" and "Details". "ID" is AutoNumber. At the time of
the
input data using a form field "QTY" to number 2, then automatically, on
the
table B, increased 2 lines, where the field "ID2" contains the number
"001-1"
and "001-2", where "001" comes from "ID" and "-1" and "-2" comes from
"QTY" =
2. If the next record, in the "QTY" I input 3, then the "ID2" = "002-1",
"002-2", 002-3 ".
The question is, how do I make this in Access?
Thank you in advance.

Rgds,
Maulwy



.

  #4  
Old March 18th, 2010, 10:18 PM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Creating Sub Item in Access

It is rarely necessary (and most often not advised) to create empty "dummy"
records for such parent/child relationships.

The more common approach is to use a main form/subform design, add related
"child" records to a parent, but check the parent record to get the maximum
number of children allowed.

Good luck!

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" wrote in message
news
Dear Jeff,

Basically, my desire is the existence of a function that limits the number
of rows in Table B based on the amount that has been input in table A.
Examples of cases, delivery order transactions, in the master transaction
(Table A), has been input 2 goal posts. If this transaction commits,
automatically, the program adds 2 new lines in Table B, which will be used
to
fill the delivery destination address. So, what will be input in Table A,
will limit the number of rows in Table B. When I use a sub form, it can
not
restrict it. What I want, Table B is a detail of Table A, where the number
of
rows in Table B, depending on what the inputs in table A, so that users
can
not be input to more / less than what has been input in Table A . Almost
the
same as the sub form, only the number of rows in the sub form, depending
on
the amount that has been input in Table A.
Thank you in advance.

"Jeff Boyce" wrote:

First off, you probably wouldn't need to ...

The notion of a relational database is that you can put records in your
tableB that are related to records in your tableA. You would have a
field
in tableB to hold a "foreign key" (check Access HELP if this term is
unfamiliar) that points back to the ID from tableA that "owns" the record
in
tableB.

If you are trying to introduce formatting like "001-1", "001-2", etc.,
use a
query to join the tables and display values from those two tables to look
like that.

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" wrote in message
...
Dear All,

I have a table A, which consists of the field "ID" and "QTY", and Table
B,
which consists of "ID2" and "Details". "ID" is AutoNumber. At the time
of
the
input data using a form field "QTY" to number 2, then automatically, on
the
table B, increased 2 lines, where the field "ID2" contains the number
"001-1"
and "001-2", where "001" comes from "ID" and "-1" and "-2" comes from
"QTY" =
2. If the next record, in the "QTY" I input 3, then the "ID2" =
"002-1",
"002-2", 002-3 ".
The question is, how do I make this in Access?
Thank you in advance.

Rgds,
Maulwy



.



 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.