Results 1 to 9 of 9
  1. #1
    Stretch617 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    5

    Taxi fare lookup based on no. passengers

    Doing a taxi fare form. You enter the number of passengers from a drop down. Depending on the number, depends on the fare.



    I have all the fares in a table in two currencies, CI and US. There is a standard fare for 1-3 passengers, and then each extra passenger up to 10 passengers incurs an add on. All calculated fares are in the rates table.

    What I want to do: I have a trip table. I want to record each trip with the destination and fare for that trip, which obvo depends on the number of passengers.

    How can I set it up so that if you select 4 passengers on the form, it selects the appropriate fare and puts that info into the trip table?

    I have attached the db. Please help! Not sure if I need to do a query or write some code for this, very new to access! Thanks!

  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
    I don't see all the fares accounted for. The base fare appears to be in the destination table, and I assume the Farex4 table is for 4 people? If so, I wouldn't have separate tables like that. What's the fare for 5 people? 7 people? What's the actual structure? Is it a fixed amount per extra person?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Stretch617 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    I don't see all the fares accounted for. The base fare appears to be in the destination table, and I assume the Farex4 table is for 4 people? If so, I wouldn't have separate tables like that. What's the fare for 5 people? 7 people? What's the actual structure? Is it a fixed amount per extra person?
    Hey, thanks for the response. I've attached the rates spreadsheet, I've been trying to figure out how to set the tables up for this.

    There are 253 destinations. These can be used as a primary key.

    Each trip can have 1-3 passengers, for which they will be charged the base rate (see Columns B & C - FareUS & FareCI) then 4 - 10 passengers get charged a different rate.

    The Trips form needs to have a drop down option for destination and then number of passengers, and then display the correct fare amount in both US and CI, and then write that information to the Fares table so that the Fares table keeps an accurate track of each fare's information.

    Am pretty sure this should be easy!

  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
    The spreadsheet fell out somewhere over Florida!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Stretch617 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    5

    Wink

    Quote Originally Posted by pbaldy View Post
    I don't see all the fares accounted for. The base fare appears to be in the destination table, and I assume the Farex4 table is for 4 people? If so, I wouldn't have separate tables like that. What's the fare for 5 people? 7 people? What's the actual structure? Is it a fixed amount per extra person?
    Quote Originally Posted by pbaldy View Post
    The spreadsheet fell out somewhere over Florida!
    Ay ay ay!! Here it is

  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
    It would have been much easier if the extra passengers were a set amount (base fare $10, each passenger over 3 is $3 type of thing). It looks like they vary on the 6th and 9th passengers. I'm torn between a proper normalized table and one like your spreadsheet.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Stretch617 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    It would have been much easier if the extra passengers were a set amount (base fare $10, each passenger over 3 is $3 type of thing). It looks like they vary on the 6th and 9th passengers. I'm torn between a proper normalized table and one like your spreadsheet.
    Thanks so much for your help on this. The rates were worked out as follows:

    4 persons = rate x 1.33
    5 persons = rate x 1.66
    6 persons = rate x 2
    7 persons = rate x 2.33
    8 persons = rate x 2.66
    9 persons = rate x 3
    10 persons = rate x 3.33

    I applied a formula in excel to calculate the additional passenger rates for both CI and US amounts. Attached is the original spreadsheet. Does this help?

  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
    Well, your problem is simpler if you can live with an equation:

    BaseRate + (BaseRate / 3 * QtyOverBase)

    Applied to your spreadsheet, it produces rates pennies off from some, see attached. In that scenario, all you store is the 2 base rates, and perhaps the associated quantity (3). If you want to stay with yours, it's doable, just seems like more work to me.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Stretch617 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    Well, your problem is simpler if you can live with an equation:

    BaseRate + (BaseRate / 3 * QtyOverBase)

    Applied to your spreadsheet, it produces rates pennies off from some, see attached. In that scenario, all you store is the 2 base rates, and perhaps the associated quantity (3). If you want to stay with yours, it's doable, just seems like more work to me.
    I'm not sure if I will have to stay with my figures I will check that out, thanks for this. I'm not sure how I would apply the formula in Access though?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. lookup
    By mmori in forum Forms
    Replies: 1
    Last Post: 03-25-2011, 06:14 PM
  2. lookUp
    By Balen in forum Access
    Replies: 2
    Last Post: 08-08-2010, 02:09 AM
  3. Replies: 1
    Last Post: 07-29-2010, 05:39 PM
  4. Total based on Formula based on field value
    By cjbuechler in forum Reports
    Replies: 15
    Last Post: 07-10-2009, 09:56 AM
  5. Lookup
    By neon'00 in forum Forms
    Replies: 2
    Last Post: 04-14-2007, 01: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