473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to add multiple records with a form/subform?

I am building an application to track the distribution and returns of
copies of magazines.

Copies of a magazine that are unsold are returned by the retailer to
the wholesaler. They are destroyed by the wholesaler and the
wholesaler supplies the publisher (me) with a report (affidavit)about
which copies are destroyed.

The report (affidavit)from the wholesaler is dated and numbered and
says how many copies of each issue were returned that week. For
example there may be 25 copies of the December issue of Magazine A, 50
copies of the January issue of Magazine B and 12 copies of the
December issue of Magzine C returned by Wholesaler A.

For billing purposes and sales reports etc, all this needs to to be
tracked by magazine, issue, and wholesaler.

I have a table called returns with the following fields:
WholesalerName
MagazineName
IssueCode
CopiesReturned
AffidavitDate

I'd like to have a form that allows the user to input the Wholesaler,
The AffidavitDate, AffidavitNumber, and then the name of each
magazine, issue code and number of copies returned.

Basically the Wholesaler, affidavit date and affidavit number will be
the same for each set of magazine name, issue, and copies returned. I
thought the way to do this would be to use a form/subform.

Is this a correct assumption? And how should I set up my master/child
links?

Thanks in advance for your help!
AffidavitNumber
Nov 12 '05 #1
4 4844
"Don Seckler" <dj*******@hotmail.com> wrote in message
news:fe**************************@posting.google.c om...
I am building an application to track the distribution and returns of
copies of magazines.

Copies of a magazine that are unsold are returned by the retailer to
the wholesaler. They are destroyed by the wholesaler and the
wholesaler supplies the publisher (me) with a report (affidavit)about
which copies are destroyed.

The report (affidavit)from the wholesaler is dated and numbered and
says how many copies of each issue were returned that week. For
example there may be 25 copies of the December issue of Magazine A, 50
copies of the January issue of Magazine B and 12 copies of the
December issue of Magzine C returned by Wholesaler A.

For billing purposes and sales reports etc, all this needs to to be
tracked by magazine, issue, and wholesaler.

I have a table called returns with the following fields:
WholesalerName
MagazineName
IssueCode
CopiesReturned
AffidavitDate

I'd like to have a form that allows the user to input the Wholesaler,
The AffidavitDate, AffidavitNumber, and then the name of each
magazine, issue code and number of copies returned.

Basically the Wholesaler, affidavit date and affidavit number will be
the same for each set of magazine name, issue, and copies returned. I
thought the way to do this would be to use a form/subform.

Is this a correct assumption? And how should I set up my master/child
links?

Thanks in advance for your help!
AffidavitNumber

Don
If you have got to the stage of forms, subforms and master/child links, then
you must have a reasonable understanding of relational databases. One basic
idea is that data within the tables is not duplicated - that is
AffidavitNumber 0123 is only recorded once - even if 4 batches of magazines
were returned under that number.
In other words, a more standard design would be to have two tables:

tblReturns - (RetID, RetDate, RetWholesalerID, RetAffidavitNo, etc)
tblReturnItems (ItmID, ItmRetID, ItmMagID, ItmQty, etc)

That way, the master field is RetID (primary key from tblReturns) and the
child key is ItmRetID (matching key in tblReturnItems)

Although, it adds an extra layer of complexity, that is the standard way to
do it. Does that help?

Fletcher

Nov 12 '05 #2
Fletcher,

I am a semi-experienced newbie. I fiddle with access when the need
arrises, I don't do it full time, so sometimes I miss the obvious.

Sometimes it takes a whack with the old "obvious" two by four for me
to get it.

Thanks so much for your help!

Don
If you have got to the stage of forms, subforms and master/child links, then
you must have a reasonable understanding of relational databases. One basic
idea is that data within the tables is not duplicated - that is
AffidavitNumber 0123 is only recorded once - even if 4 batches of magazines
were returned under that number.
In other words, a more standard design would be to have two tables:

tblReturns - (RetID, RetDate, RetWholesalerID, RetAffidavitNo, etc)
tblReturnItems (ItmID, ItmRetID, ItmMagID, ItmQty, etc)

That way, the master field is RetID (primary key from tblReturns) and the
child key is ItmRetID (matching key in tblReturnItems)

Although, it adds an extra layer of complexity, that is the standard way to
do it. Does that help?

Fletcher

Nov 12 '05 #3
Fletcher,

I set the tables up the way you suggested (I Think):

ReturnsTBL
--------
WholesalerName
AffidavitDate
AffidavitNumber
ReturnID (autonumber and index based on Wholesalername and
AffidavitNumber Fields)
ReturnItemsTBL
---------------
ItemID (Autonumber)
MagName
IssueCode
ReturnQty
Would it be best to put these on a form/subform and use the ReturnID
and ItemID as the master and child links? If so, is that a problem
because they are autonumber and this form is for data entry. How
would I, or do I need to get these auto numbers to generate temselves
before the records are added to their respective tables.

Thanks in advance for your help.

Don
If you have got to the stage of forms, subforms and master/child links, then
you must have a reasonable understanding of relational databases. One basic
idea is that data within the tables is not duplicated - that is
AffidavitNumber 0123 is only recorded once - even if 4 batches of magazines
were returned under that number.
In other words, a more standard design would be to have two tables:

tblReturns - (RetID, RetDate, RetWholesalerID, RetAffidavitNo, etc)
tblReturnItems (ItmID, ItmRetID, ItmMagID, ItmQty, etc)

That way, the master field is RetID (primary key from tblReturns) and the
child key is ItmRetID (matching key in tblReturnItems)

Although, it adds an extra layer of complexity, that is the standard way to
do it. Does that help?

Fletcher

Nov 12 '05 #4
"Don Seckler" <dj*******@hotmail.com> wrote in message
news:fe**************************@posting.google.c om...
Fletcher,

I set the tables up the way you suggested (I Think):

ReturnsTBL
--------
WholesalerName
AffidavitDate
AffidavitNumber
ReturnID (autonumber and index based on Wholesalername and
AffidavitNumber Fields)
ReturnItemsTBL
---------------
ItemID (Autonumber)
MagName
IssueCode
ReturnQty
Would it be best to put these on a form/subform and use the ReturnID
and ItemID as the master and child links? If so, is that a problem
because they are autonumber and this form is for data entry. How
would I, or do I need to get these auto numbers to generate temselves
before the records are added to their respective tables.

Thanks in advance for your help.


Hi Don
You seem to have missed the most important field in all this! That is,
there must be a field in the ReturnItems table to indicate which Return the
item is part of. ie, you need a field ReturnItems.ReturnID which matches
the ReturnID in the Returns table.

I didn't quite get your idea about ReturnID being 'an autonumber and index
based on Wholesalername and AffidavitNumber Fields', but it doesn't sound
the sort of thing I would do. I would have ReturnID as an autonumber and
ItemID as an autonumber and tblReturnItems.ReturnID (the matching key) being
a long integer. This allows you to easily select Tools>Relationships and
enforce referential integrity between the 2 fields and it means that
designing the forms is easy. You do not display any of these three keys -
the autonumbers are generated automatically when you create a new record,
and the long integer (tblReturnItems.ReturnID) is inserted from having the
master/child links with the form/subform.

If I were designing the tables I usually give each field in the table a 3
letter prefix - it ensures that each field is unique across the database,
avoids reserved words such as 'name' and 'date' and helps also with the
foreign keys. For example RetID is the autonumber primary key from the
returns table, ItmID is the autonumber from the items table, but ItmRetID
tells me that the field lives in the Items table, but is actually the
ReturnID. If this results in somewhat geeky names, it really doesn't matter
as these are never displayed to the user - tblContacts.ConName might be
simply labelled 'name' on the form, and I would not advise having a field
called 'name'. Just a thought.
Fletcher
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robin S. | last post by:
I tried to ask this question several days ago, but I didn't explain my application correctly. Basically I want to have one record from table "A" and I want to display, say, 5 records from table...
1
by: April | last post by:
I am working on a database to be used for auditing medical groups. TABLE:DETAILS contains these fields: (autonumber) 50 group fields through each a combo box that pulls from the same...
6
by: Wendy Powley | last post by:
I have a subform which represents a 1:N relationship with the main form. I would like to be able to read values from an external file, fill the subform with the values read & allow the user to...
0
by: misscrf | last post by:
I am currently working on a database, in 3rd normal form, which is for candidates who apply for a job with the law firm that I workd for. My issue is with good form design. I have a main...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
5
by: Kaur | last post by:
Hi, I have been successful copying a vba code from one of your posts on how to copy and paste a record by declaring the desired fields that needs to be copied in form's declaration and creating two...
1
by: Wan | last post by:
Hi, I have a test project consists of two forms. The main form contains a datagrid and a button. On click of button I populate the datagrid with a ds.table(0) so far so good and on grid's...
6
by: Otis492 | last post by:
Hello, I have been struggling with this for a while. I am working on a rather simple database for claims in Access 2003. I have a table called claims that has a primary key field called Claim #. ...
0
by: TD | last post by:
I have a main form with two subforms (both in datasheet view), neither of which are linked to the main form. The main form is based on a query that uses the bound column of a combobox on the main...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.