Results 1 to 4 of 4
  1. #1
    Mister M is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    1

    Choosing among multiple formulas

    I am repeatedly calculating the same thing and want to make a simple database to make life simpler.

    i have a job table, the employees table and a truck table (there are 3 or 4 different size rigs). I have 4 different formulas that i must choose among for calculating their mileage fee.



    i am very new to access and wonder what the simplest way is to choose among 4 different formulas to calculate the fee

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Post your formulas for analysis. What are the rules for choosing?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    You need to define your 4 conditions e.g. RigSize = "Small" or "Medium" etc then use one of these :

    a)
    Code:
    If Condition1 Then
     'condition1 code here...
    ElseIf Condtion2 Then
     'condition2 code here...
    ElseIf Condtion3 Then
     'condition3 code here...
    Else 
     'condition4 code here...
    End If
    OR use Select Case which is neater & may run slightly faster

    Code:
    Dim intCondition As Integer
    
    Select Case intCondition
    
    Case 1
    'condition1 code here...
    Case 2
    'condition2 code here...
    Case 3
    'condition3 code here...
    Case 4
    'condition4 code here...
    End Select
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    In addition to the advice/comments so far, I recommend you tell us in simple English what information exactly will you use/get from this proposed database. There may be some options or more info relevant to the database and its design if we knew more about it.
    Good luck with the project and welcome to the forum.

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

Similar Threads

  1. choosing language
    By MykeRuiz in forum Programming
    Replies: 1
    Last Post: 06-27-2016, 09:14 AM
  2. Replies: 3
    Last Post: 07-03-2014, 08:40 AM
  3. Choosing Multiples in a form
    By Jackfam58 in forum Forms
    Replies: 1
    Last Post: 07-31-2012, 08:41 AM
  4. Choosing Report
    By ShadeRF in forum Reports
    Replies: 12
    Last Post: 11-18-2011, 11:31 AM
  5. help in choosing from list
    By Nokia N93 in forum Programming
    Replies: 4
    Last Post: 11-30-2010, 07:29 AM

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