Results 1 to 2 of 2
  1. #1
    BrianFawcett is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    7

    Calculating values based on Combobox value

    I am trying to write code that will calculate the value of a field in a report based on the value the user chooses in a comboBox (the values are 1-5). I know there are more efficient ways to do this than a large nested IF statement. Can some one help me out.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Select case may be some thing that you might be looking for.

    Example:

    Select Case Me.ComboBox1

    Case is = 1
    Me.Text1=Me.Text2*1
    Case is =2
    Me.Text1=Me.Text2*2
    Case is =3
    Me.Text1=Me.Text2*2
    End Select

    try this out let me know if you need any help. if This solves your problem mark the thread solved.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  2. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  3. Query based on Value in a Combobox
    By martinwd in forum Queries
    Replies: 3
    Last Post: 06-02-2009, 02:21 PM
  4. query based on two combobox
    By datto in forum Queries
    Replies: 0
    Last Post: 04-18-2007, 11:10 PM
  5. Calculating Values
    By Jahan in forum Queries
    Replies: 1
    Last Post: 07-09-2006, 09:15 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