Page 1 of 4 1234 LastLast
Results 1 to 15 of 47
  1. #1
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24

    simple agent/commission report

    Hello, with limited Access 2010 knowledge, I have created a small database for a real estate office to show reports of commission for each agent and for the total office.



    I have a table of all 30 agents in the office called Agents:
    ID | Agent

    I made a form to input each sale that contains the following fields:

    ID | Street Address | Selling Price | Commission % | Gross Commission | Listing Agent | Listing Agent Commission (LAC) | Listing Agent 2 | LAC 2 | Selling Agent | Selling Agent Commission (SAC) | Selling Agent 2 | SAC 2 | Pending / Closed | Net to Office

    All this info goes into Table1

    The Listing Agent, Listing Agent 2, Selling Agent, Selling Agent are all drop down lists that is taken from the Agents table.
    The Pending/Closed field is also a drop down of the 2 choices.

    Sometimes the agents share listing a property or share in selling a property, hence the listing agent 2 or selling agent 2.
    Sometimes one agent is the listing and the selling agent on a single property.
    I would like to run a report that lists total commission for each agent for all of their pending or closed sales - whether or not they are the listing agent, 2nd listing agent on a property, selling agent, 2nd selling agent or listing and selling agent.
    Commissions stay same for the agents but change for each property so Property 1 -Commission = 6% of the selling price. It could then be 4 for the listing agent ( or 2% & 2% if there's a 2nd agent) and 2% for the selling agent.

    Each property entered into Table1 has an ID field which is the primary for the table and set to Autonumber but each property also has a property ID (PID) which is unique to the property but the property could be sold twice in one year so I didn't want to use it as a primary.
    This doesn't seem to be working for me:

    SELECT Table1.
    [Listing Agent], Table1.LAC, Table1.
    [Listing Agent 2], Table1.LAC2, Table1.[Selling Agent], Table1.SAC, Table1.[Pending/Closed], Table1.[LAC]+[LAC2]+[SAC]+[SAC2] AS [GCI to Date]
    FROM Table1
    WHERE (((Table1.
    [Listing Agent])="John Smith")) AND
    WHERE (((Table1.
    [Listing Agent 2])="John Smith")) AND
    WHERE (((Table1.[Selling Agent])="John Smith")) AND
    WHERE (((Table1.[Selling Agent 2])="John Smith"));

    Thanks for the help in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For starters, I think you've made a design mistake. Normalization rules would dictate another table related one-to-many on the sale ID or similar field. That table would have a record for each agent involved. That makes your search simple. That said, you want "OR" instead of "AND", plus you don't repeat the word "WHERE".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Thanks Paul,
    This second table with the one-to-many relationship, what fields would I move to there and what fields could be left in the main table?
    Could there be an issue if the property sells twice in the same year with regards to that design?
    Lastly, is there any way I could fix this without the redesign .
    Steve

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, I already addressed how to fix the problem with the current design:

    Quote Originally Posted by pbaldy View Post
    That said, you want "OR" instead of "AND", plus you don't repeat the word "WHERE".
    The agent fields would go to the new table, probably the percentage for each agent, and perhaps a field to designate which role they played in this sale. You could sell it 100 times a year with that design, presuming your other tables were structured properly. I'd expect a property table and a sales table in addition to this one. And an agents table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Alright, so the redesign would look like this?:

    tblProperty

    PID – long integer (PK)
    Streetaddress - text
    City - text

    tblAgents
    AgentID – Autonumber (PK)
    Agent – text
    Role (listing agent, listing agent 2, selling agent, selling agent 2) - text

    tblSales
    PID – long (PK)
    SellingPrice - currency
    Commissionpercent (of sale price) long integer
    GrossCommission – currency
    PendingClosed – text
    Nettooffice – currency

    Am I missing anything?
    Thanks

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Yes, the table I suggested. I'd take the role out of the agents table, since presumably it can vary. New table, perhaps tblCommissions:

    tblCommissions
    CommID - autonumber PK
    PID - FK from tblSales
    AgentID - FK from tblAgents
    Role
    Commission

    So if a given sale had 3 agents involved, there would be 3 records in this table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Do I need the Commission to be associated with the agents as it just for the properties - Commissions stay same for the agents but change for each property so Property 1 -Commission = 6% of the selling price. It could then be 4 for the listing agent ( or 2% & 2% if there's a 2nd agent) and 2% for the selling agent. But they only charge 6, 5, 4 sometimes 4.5% but mostly 6% as a standard. All agents are 50/50 with the company so does there even need to be a Commissions table. Sorry for all the questions. just not really good at this.

    Thanks, Steve

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It's your baby, but my sense of it is that the commission should be in the new table, because it can change from sale to sale. I may get 4% for one sale and 2% for another, correct? In other words, commission is an attribute of the sale, not the agent.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Got sidetracked with other projects now I am back to this one.

    I redid the tables and created the relationships, now I am trying to create a form with a subform below that will have 4 lines each with Agent | Role| Commission . After entering the property information in the form, the user will then choose up to 4 agents, choose their role in the transaction and then enter the commission.

    When creating the form in the wizard it doesn't ask me the "How do you want to view your data?" question. I am guessing that the one to many relationship I created is wrong.

    Attached are 2 pics of the relationships and the form I am thinking of.

    many thanks
    Steve
    Attached Thumbnails Attached Thumbnails form.jpg   relationships.jpg  

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For starters, I'd expect a relationship between commissions and sales on the sales ID, not commissions and properties. The commission is connected to a sale, is it not? Then you'd have a form bound to the sales table and a subform bound to the commissions table, with master/child relationship on the sales ID.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Does this look better? or is there more?


    Click image for larger version. 

Name:	relationships2.jpg 
Views:	8 
Size:	35.0 KB 
ID:	12435

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You tell me; does it sound reasonable that Sales ID is related to Agent ID? The commission table should have sales ID in it rather than PID.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Well I was thinking that the one to many relationship should be with the sales to the agents. I think I am seeing it now.

    Agents - onetomany with commissions because one agent can have many commissions.
    Property - onetomany with Sales table for the same reason
    I replaced PID in the Commissions table with SalesID and its the foreign key with a manytoone relationship for the SalesID in the Sales table.

    This is where I get confused creating that last relationship.

    Thanks for the patience with a super novice,
    Steve
    Click image for larger version. 

Name:	relationships3.jpg 
Views:	8 
Size:	36.9 KB 
ID:	12438

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Looks like you have it now.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    smil27 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    24
    Thanks for the help Paul

    Can I just copy and paste the Agent, Role, & Commission boxes on the subform to allow for 4 agents.
    The thing I am wondering is how will it know which role and commission is for which agent?
    see below -
    Click image for larger version. 

Name:	form2.jpg 
Views:	9 
Size:	134.5 KB 
ID:	12443

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to work out commission rates
    By matpaulin in forum Queries
    Replies: 1
    Last Post: 02-07-2013, 06:15 PM
  2. how to generate this simple report in report ms access
    By learning_graccess in forum Reports
    Replies: 1
    Last Post: 11-26-2011, 02:10 PM
  3. Creating a simple report?
    By berni3883 in forum Reports
    Replies: 1
    Last Post: 03-29-2011, 12:31 PM
  4. Simple Report by Month
    By leejqs in forum Reports
    Replies: 3
    Last Post: 07-15-2009, 09:24 AM
  5. Probably a simple report question
    By gmurrie in forum Reports
    Replies: 1
    Last Post: 12-28-2005, 09:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums