Results 1 to 5 of 5
  1. #1
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49

    Question Get combobox rows from one table and use it to populate another

    Hi everyone,
    I have a table (tbl_SampleActivity) that has fields SampleTypeID and SamplerID, among others.
    These two fields are in a many to one relationship with tbl_SampleType (fields SampleTypeID and SampleDesc) and tbl_Sampler (fields SamplerID and SamplerName), respectively.

    I would like to add rows to tbl_SampleActivity using a form.


    One combobox is populated with SampleDescs and another is populated with SamplerNames.
    I want to use these fields to populate tbl_SampleActivity with the related numberic IDs.

    Can anyone help me out?
    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Have you tried the combo wizard on a form bound to tbl_SampleActivity?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49
    How do I bind my form to a table? I assume that Record Source needs to contain some kind of query. Right now it says SELECT * FROM tbl_SampleActivity. Does this mean it is bound to tbl_SampleActivity?

    I have tried using the combobox wizard on the form. I can get it to populate the combobox with the necessary descriptions but it will not populate my table with the corresponding ID.

  4. #4
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49
    Alright, I'm slowly figuring out this form business...
    I was confused by Access' terminology. I was thinking of it terms of I'm writing new records TO a table, but Access calls this table the "source". So If I set the control source to the table record I want to update, I can set the row source to the row I want to populate the control with. If I use a select statement to select both the ID column and the description column, I can then set the column widths to 0; whatever, which will hide the ID column.
    yay.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Glad you got it sorted out.
    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. Table rows to columns
    By Rhino373 in forum Programming
    Replies: 5
    Last Post: 12-22-2011, 01:44 PM
  2. Populate a field based on combobox selection
    By rscott7706 in forum Access
    Replies: 5
    Last Post: 06-02-2011, 03:18 PM
  3. Replies: 0
    Last Post: 02-13-2011, 02:55 PM
  4. overwriting table rows
    By VickyC in forum Forms
    Replies: 2
    Last Post: 09-23-2010, 07:58 AM
  5. Replies: 1
    Last Post: 08-14-2009, 08:41 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