473,395 Members | 2,468 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,395 software developers and data experts.

Subform is creating extra data

I am in the design phase of a new database and am having a devil of a
time with a subform.

I have three tables that relate to problem - Suppliers tbl, Customers
tbl and a SuppliersCustomers tbl. The intent is to have the user enter
in spend information by customer with each supplier. Sounds simple
enough right?

The common fields in each table are as follows:

Supplier tbl - suppliername, suppliernumber
Customers tbl - customername, customernumber
SuppliersCustomers tbl - suppliername, customername, month, year,
Spend$, SpendUnits

I have 45 suppliers listed in the Suppliers tbl.

My main form has 45 records one for each supplier. It contains the
suppler name and additional information from the suppliers tbl.

Subform1 is based on a query of the SuppliersCustomers tbl. It already
has the SupplierName field populated from the main form(it is hidden to
avoid displaying redundant information). It also has Customername
which is a combobox lookup in the supplier tbl. The form user selects
a customername from the combobox dropdown.

Subform2 is also based on the same query as Subform1. It already has
the SupplierName and Customer Name fields auto populate based on the
supplier of record, and the customer that was selected in Subform1. It
also contains fields for month and year that appear as "Current"
default values. Spend$ and Spend Units are entered by the user.

So, the user is really only entering 3 pieces of information...

1. Selecting Customer from combobox lookup of Customers tbl
2. Entering Spend$
3. Entering SepndUnits

What is my problem you ask???

Well, for each line of data that is entered, I am getting two records
for each entry in my SuppliersCustomers tbl - one with the data user
entered, one with $0.00 spend and $0.00 units.

e.g. If I select customer Joe Smith from the customer tbl in subform1
and enter $1000 in spend and 100 units, I will get two records in
SuppliersCustomers tbl one for the actual data and one for Joe Smith
with $0.00 spend and $0.00 units.

Can anyone help me please? Why am I getting the double entries?

Is my form design bad?

What can I do to eliminate double entry?

I have spend about 10 hours trying to correct this already. Any help
anyone can provide would be GREAT!!!!!

Nov 13 '05 #1
1 2188
Trent wrote:
I am in the design phase of a new database and am having a devil of a
time with a subform.

I have three tables that relate to problem - Suppliers tbl, Customers
tbl and a SuppliersCustomers tbl. The intent is to have the user enter
in spend information by customer with each supplier. Sounds simple
enough right?

The common fields in each table are as follows:

Supplier tbl - suppliername, suppliernumber
Customers tbl - customername, customernumber
SuppliersCustomers tbl - suppliername, customername, month, year,
Spend$, SpendUnits

I have 45 suppliers listed in the Suppliers tbl.

My main form has 45 records one for each supplier. It contains the
suppler name and additional information from the suppliers tbl.

Subform1 is based on a query of the SuppliersCustomers tbl. It already
has the SupplierName field populated from the main form(it is hidden to
avoid displaying redundant information). It also has Customername
which is a combobox lookup in the supplier tbl. The form user selects
a customername from the combobox dropdown.

Subform2 is also based on the same query as Subform1. It already has
the SupplierName and Customer Name fields auto populate based on the
supplier of record, and the customer that was selected in Subform1. It
also contains fields for month and year that appear as "Current"
default values. Spend$ and Spend Units are entered by the user.

So, the user is really only entering 3 pieces of information...

1. Selecting Customer from combobox lookup of Customers tbl
2. Entering Spend$
3. Entering SepndUnits

What is my problem you ask???

Well, for each line of data that is entered, I am getting two records
for each entry in my SuppliersCustomers tbl - one with the data user
entered, one with $0.00 spend and $0.00 units.

e.g. If I select customer Joe Smith from the customer tbl in subform1
and enter $1000 in spend and 100 units, I will get two records in
SuppliersCustomers tbl one for the actual data and one for Joe Smith
with $0.00 spend and $0.00 units.

Can anyone help me please? Why am I getting the double entries?

Is my form design bad?

What can I do to eliminate double entry?

I have spend about 10 hours trying to correct this already. Any help
anyone can provide would be GREAT!!!!!


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, it is a good idea to change the SuppliersCustomers table to use
the CustomerNumber & SupplierNumber instead of the "Names" columns.
Numbers are smaller in the DB & faster in searches.

I would have set up the form like this:

+------------------------------------------
| Suppliers
| +--------------------------------------
| | SuppliersCustomers subform
| |
| | Customer ComboBox
| | < other fields >

Set the RecordSource for the Suppliers to the Suppliers table. Set the
RecordSource for the SuppliersCustomers subform to the
SuppliersCustomers table.

Set the SuppliersCustomers subform Master/Child Link Fields to
SupplierNumber in the Suppliers form. Set the Customer ComboBox
RowSource property to a query that will pull the CustomerNumber and
CustomerName:

SELECT CustomerNumber, CustomerName FROM Customers ORDER BY 2

Bind the Customer ComboBox to the CustomerNumber column in the
SuppliersCustomers table. The Customer ComboBox is now a data-entry
control, not a record search control.

Train your users to search for the Customer by using the Find (Ctrl-F)
or the Filter (right click: select one of the Filter options) instead of
using a selected item from the Customer ComboBox drop-down list as the
search criteria.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQizatoechKqOuFEgEQKkewCgpEuOD7UDrB0G34/h666fjc0vmpMAnjM1
hBUi1Jaa7cjjh8+L72wpMHaE
=J4Ae
-----END PGP SIGNATURE-----
Nov 13 '05 #2

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

Similar topics

3
by: Illya Havsiyevych | last post by:
Hello All I have splitted my MDB into MDE and data MDB. In old whole MDB I have next piece of code to create an instance of a form with subform. ..... Dim objForm As New ...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
1
by: Traci | last post by:
My problem is in a form/subform. On the main form I have an unbound listbox named OptionsInPlan. In the OnCurrent event of the main form I set the value of the listbox with the code:...
4
by: Mason | last post by:
This is probably an incredibly newbie-ish question. I just haven't had the cause to use many subforms before, so I'm pretty sure I just don't understand it correctly (even after reading up on it)....
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
2
by: docsix | last post by:
I am having trouble basing a combo box in a subform that gives selected data from the mainform combo box. Basically combo box1 gives a restricted data set to combo box2. Here is an small sample of...
4
by: Jacopo | last post by:
Dear ladies and gents, I am quite disoriented while trying to do something. I have developed a database in access, creating only unbound forms that on opening retrieve recordsources of the controls...
2
by: Craig | last post by:
I am trying to create a form that shows quote info, but also has a subform that lists all keywords and allows you to select multiple keywords to associate with that quote. I have never done a...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.