Results 1 to 5 of 5
  1. #1
    Phased is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3

    Need Help With Combo Box

    Hello, I am currently building a Database about a Driving School so to speak, I have a Table named tblTest and I have a Combo Box for an entity labelled "TestType" which has 2 selections: "Practical" & "Theory" the last entity is labelled "TestCost" is it possible for the TestCost to change depending on what the user selects in the TestType Combo Box? If so how is this done?



    I have looked all over the internet for help, and alas have had no such luck so far, thanks in advance for any contributions

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Something like this might help with the concept. This just uses the value selected in the combo, and outputs a phrase in a textbox called Txtbox on the Form. Any calculation could be done.

    Private Sub cmbTestType_AfterUpdate()
    'Test to have different calculation based on Combo Selection
    If Me.cmbTestType.Value = "Practical" Then
    Me.TxtBox = "Test Cost is $50.00" 'Practical test
    Else
    Me.TxtBox = "Test Cost is $20.00" 'Theory test
    End If
    End Sub
    Hopefully you are not storing the calculated result in your table.

  3. #3
    Phased is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    Thank you for your reply I am not storing the calculated result no. Also where would I place that code? I am quite the Access novice

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    This is in the AfterUpdate Event of the Combobox.

    Check with Access help or do some google search

    Here's one http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx

    good luck

  5. #5
    Phased is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    Thank you very much!

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

Similar Threads

  1. Replies: 8
    Last Post: 06-23-2014, 12:19 PM
  2. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  3. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  4. Replies: 3
    Last Post: 02-26-2009, 10:17 AM
  5. Replies: 0
    Last Post: 08-17-2008, 12: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