473,769 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SuppliersCustom ers 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
SuppliersCustom ers 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 SuppliersCustom ers 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 SuppliersCustom ers 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
SuppliersCustom ers 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 2208
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 SuppliersCustom ers 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
SuppliersCustom ers 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 SuppliersCustom ers 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 SuppliersCustom ers 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
SuppliersCustom ers 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 SuppliersCustom ers 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
| +--------------------------------------
| | SuppliersCustom ers subform
| |
| | Customer ComboBox
| | < other fields >

Set the RecordSource for the Suppliers to the Suppliers table. Set the
RecordSource for the SuppliersCustom ers subform to the
SuppliersCustom ers table.

Set the SuppliersCustom ers 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
SuppliersCustom ers 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:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQizatoechKq OuFEgEQKkewCgpE uOD7UDrB0G34/h666fjc0vmpMAnj M1
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
4934
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 Form_frmParentFormWithSubForm objEditForms.Add objForm
25
10264
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
1
2512
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: Me!OptionsInPlan.Value = Me!OptionsInPlan.ItemData(0) For some records there are no rows in the listbox. I want to have the subform track the value of the listbox so I set the LinkMaster property to OptionsInPlan and the LinkChild property to ElevationID....
4
2316
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). I have a relationship set up that is used to track the hours an employee has worked on each project during the week. I'm trying to set up a Form to allow someone to choose their name and a Period Ending date (basically, the tblTimeReport...
4
7018
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
1
4442
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 created a MainTable (and related form), which has an associated SubForm (popup) along with its underlying, separate Table. The tables' relationship is one to many respectively. The primary key
2
2351
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 the data, the data comes from two lists. Table:Facilities - FacilityID ... FacilityType 1 ............ Bus 2 ............ Library Table: Additional
4
2507
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 from the tag and connect to the tables through ADO recordsets created (where in editing mode) as keysets with an optimistic lock. Now the problem i have is with a form like an invoice. The main form binds to the data table containing the...
2
1475
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 subform before and am struggling a little with it as there is an element of indirection involved. Any pointers would be greatly appreciated. A summary of my DB so far is:
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.