Results 1 to 9 of 9
  1. #1
    mlbwhf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    14

    Derived attributes

    Hi guys,

    I have a field with drop down to choose from, the options is:
    silver
    gold
    diamond


    wanted to create a field in the same table or another table where the value will come directly from this choice, so if the user silver in the first option the number 1 will be in the new field, if he choose gold 25, diamond 50.
    can you help me please?

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    The simplest way is to place a combo box on your form. In the Property Sheet (Data tab) specify the Row Source Type as Value List, the Row Source as "1;Silver;25;Gold;50;Diamond," the Bound Column as 1, the Control Source as the field that is to hold the numeric. Then under the Format tab specify the Column Count as 2 and the Column Widths as 0 (zero).

    You're done!

  3. #3
    mlbwhf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    14
    but i want to put it in a table not in a form, can i do this?

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Code:
    tblLevels
    Lev_ID  Lev_Desc  Lev_Value
    1       Silver    1
    2       Gold      25
    3       Diamond   50
    Then base your combo box on your main form with the tblLevels as your record source, keep the bound column as the lev_ID field then when you are performing any calculations or lookups you link to your tblLevels table to look up the value.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Just so we're talking apples and apples, it is important to understand:

    Tables store data
    Forms do not store data
    Forms are windows to look at the data in tables (and queries - queries are "virtual" tables)
    Forms have controls that can be bound to the record source - a table or a query.

    When you see data in a control that is on a form, you are looking at a specific field in a specific table.

  6. #6
    mlbwhf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    14
    thanks guys

  7. #7
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    ... wanted to create a field in the same table or another table where the value will come directly from this choice ...
    Sorry thought you were referring to storing the 'result' in this field.

    ssanfu: Agreed but this is more like an enumeration and a value list is one way of specifying a type of enumeration. Agreed also that if the enumerated values are subject to change then a 'value list' (lookup) table is more appropriate.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Rod: Agreed.... I use value lists in combo boxes sometimes when the list doesn't/won't change. I see a lot of "store the value in a form" comments in posts, so when I saw
    but i want to put it in a table not in a form, can i do this?
    , I was trying to make the differentiation between a table and a form.

    I missed the question totally

  9. #9
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    It should be mandatory that all newcomers to Access undergo a three day orientation (including terminology).

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

Similar Threads

  1. Using Derived Column in Where Condition
    By anunat in forum Programming
    Replies: 1
    Last Post: 07-12-2012, 10:13 AM
  2. Derived Column with SQL equation and IIF
    By rivereridanus in forum Access
    Replies: 3
    Last Post: 08-16-2011, 05:46 PM
  3. attributes out of order
    By Dornenhexe in forum Queries
    Replies: 9
    Last Post: 07-12-2010, 02:36 PM
  4. Hidden Attributes
    By NMJones in forum Access
    Replies: 1
    Last Post: 02-09-2010, 10:57 AM
  5. Calulating derived date in table
    By hedleyw in forum Access
    Replies: 2
    Last Post: 04-12-2009, 02:33 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