Results 1 to 2 of 2
  1. #1
    jaffermca is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    1

    Question Combox store the ID not the corresponding value to the table

    Hai guys,



    I am newbie to access database, I have 2 tables namely business_unit(id,b_unit) and division(id(pk), bid(fk),division) . I have created 2 combo box in my form one for b_unit and another division, based on the selection of b_unit the related division will be loaded in division.

    If i try to store the b_unit and division value from the form to the table called "training" it stores only both of the field ID's not its value.

    Please any of you help me out.

    I execute this query ,


    Private Sub Command12_Click()
    CurrentDb.Execute "INSERT INTO training(business_unit,division)" & _
    "values(" & Me.business_unit & ",'" & Me.division & " ')"
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That is what is normally done; you store the primary key of a "lookup" table in related tables. You get the corresponding values for forms and reports by joining the tables together in a query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. How can i store expressions in table?
    By smahdih in forum Access
    Replies: 9
    Last Post: 10-28-2011, 05:32 AM
  2. Replies: 1
    Last Post: 07-25-2011, 08:27 AM
  3. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 AM
  4. Replies: 3
    Last Post: 02-20-2009, 02:28 PM
  5. Replies: 0
    Last Post: 09-25-2006, 03:42 AM

Tags for this Thread

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