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

how to enter many to one

RR
What would the proper way be to enter a sale, then be able to enter 1 or
more sales persons, their "costs" to the sale, and their commission on the
sale?
Then after its been entered, have all the information show up as a part of
the sale?
Nov 13 '05 #1
3 1514
First, you'd need your tables properly designed... a Sales table, a
Salesperson table, and a SalesSalesperson table. What you have is not a
"many to one" but a "many to many" -- that is multiple salespeople per sale,
but a salesperson can also be involved in multiple sales.

The SalesSalesperson table would have foreign keys pointing to the record in
the Sales table, and to a single Salesperson. But there could be (will be)
many entries in the SalesSalesperson table for a given sale or a given
salesperson.

For a particular sale, I'd use a Subform whose RecordSource was a Query on
the SalesSalesperson table, joined to the Salesperson table. I'd use a
ComboBox in the Form embedded in the Subform Control to choose the
salesman... you may want/need to use some VBA code to create the new entry
in the SalesSalesperson table and to requery the Form embedded in the
Subform Control.

Larry Linson
Microsoft Access MVP

"RR" <te**********@yahoo.com> wrote in message
news:dv*****************@fe2.texas.rr.com...
What would the proper way be to enter a sale, then be able to enter 1 or
more sales persons, their "costs" to the sale, and their commission on the
sale?
Then after its been entered, have all the information show up as a part of
the sale?

Nov 13 '05 #2
RR
Could you explain the last paragraph in a different way? I think I
understand the first part, but not the last.
Your salessalesperson table will have filelds for their "costs" to the sale?
"Larry Linson" <bo*****@localhost.not> wrote in message
news:XmB4d.8944$Bg5.2797@trnddc07...
First, you'd need your tables properly designed... a Sales table, a
Salesperson table, and a SalesSalesperson table. What you have is not a
"many to one" but a "many to many" -- that is multiple salespeople per sale, but a salesperson can also be involved in multiple sales.

The SalesSalesperson table would have foreign keys pointing to the record in the Sales table, and to a single Salesperson. But there could be (will be)
many entries in the SalesSalesperson table for a given sale or a given
salesperson.

For a particular sale, I'd use a Subform whose RecordSource was a Query on
the SalesSalesperson table, joined to the Salesperson table. I'd use a
ComboBox in the Form embedded in the Subform Control to choose the
salesman... you may want/need to use some VBA code to create the new entry
in the SalesSalesperson table and to requery the Form embedded in the
Subform Control.

Larry Linson
Microsoft Access MVP

"RR" <te**********@yahoo.com> wrote in message
news:dv*****************@fe2.texas.rr.com...
What would the proper way be to enter a sale, then be able to enter 1 or
more sales persons, their "costs" to the sale, and their commission on the sale?
Then after its been entered, have all the information show up as a part of the sale?


Nov 13 '05 #3
The form embedded in the subform control will be based on a query joining
the SalesSalesperson table with the Salesperson table. The foreign keys in
SalesSalesperson will point to the Sales record and to the Salesperson
record (for information like, Salesperson's name).

It would be in the SalesSalesperson record, the one that ties a particular
Salesperson to a particular Sale, that the salesperson's contribution to
this sale would be stored. I am assuming different salespeople can make
different contributions to a given sale, and not necessarily the same
contribution to some other sale.

Use a ComboBox to select the Salesperson, and a textbox to enter the
contribution. The Salesperson Name will be displayed in the ComboBox, but
the id field of that salesperson will be stored. The Combo Box wizard will
lead you by the hand through setting it up.

If that doesn't help, please clarify what is not clear and I'll try to
respond.

Larry Linson
Microsoft Access MVP

"RR" <te**********@yahoo.com> wrote in message
news:6u******************@fe2.texas.rr.com...
Could you explain the last paragraph in a different way? I think I
understand the first part, but not the last.
Your salessalesperson table will have filelds for their "costs" to the sale? "Larry Linson" <bo*****@localhost.not> wrote in message
news:XmB4d.8944$Bg5.2797@trnddc07...
First, you'd need your tables properly designed... a Sales table, a
Salesperson table, and a SalesSalesperson table. What you have is not a
"many to one" but a "many to many" -- that is multiple salespeople per sale,
but a salesperson can also be involved in multiple sales.

The SalesSalesperson table would have foreign keys pointing to the record in
the Sales table, and to a single Salesperson. But there could be (will be) many entries in the SalesSalesperson table for a given sale or a given
salesperson.

For a particular sale, I'd use a Subform whose RecordSource was a Query on the SalesSalesperson table, joined to the Salesperson table. I'd use a
ComboBox in the Form embedded in the Subform Control to choose the
salesman... you may want/need to use some VBA code to create the new entry in the SalesSalesperson table and to requery the Form embedded in the
Subform Control.

Larry Linson
Microsoft Access MVP

"RR" <te**********@yahoo.com> wrote in message
news:dv*****************@fe2.texas.rr.com...
What would the proper way be to enter a sale, then be able to enter 1 or more sales persons, their "costs" to the sale, and their commission on
the sale?
Then after its been entered, have all the information show up as a
part of the sale?



Nov 13 '05 #4

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

Similar topics

5
by: junk mail | last post by:
My friend is trying to code a small c program where he wants to force the user to press enter and only enter to continue. Currently he is using getchar() with a loop but you can type any number...
5
by: ewillyb | last post by:
Hi, ASP.NET has some interesting behavior when the user hits the Enter key. If there are multiple ASP:Buttons (rendered as HTML submits) on the form, when the user hits enter, the first button's...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
6
by: Clark Sann | last post by:
Can someone help me understand what object should be used as the lock object? I've seen some programs that use Monitor.Enter(Me). Then, in those same programs, they sometimes use another object. ...
7
by: Marc | last post by:
Hi, I want my user to be able to rename a button control by selcting rename from a menu. This then opens a text box in which to enter the new name in. I want the button control to...
18
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same...
2
by: JWest46088 | last post by:
I want the user to enter information, such as names, and then I want to ask them after they entered the first name if they want to enter another name. How would I do that? This is what I have so...
7
by: Rotsey | last post by:
Hi, I am having a problem trying to select an item with the enter key. I want to work the combo with the keyboard. So when I use the down arrow to browse the list I want to then hit the...
24
by: MichaelK | last post by:
Who knows how to prevent submitting a form on the press Enter button before all fields on the form are filled up. People just enter the first field hit Enter and it submits the form and doing...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.