Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17

    How do I populate my main table from a subform in access 2003

    Hello,


    I am an intermediate user of access 2003 and new to AccessForums.net.

    I need to know how to make a subform populate my main table.

    What I have
    I have a main form that has a couple of subforms on it.
    • The subform has three fields, one being a combo box that populates the other two fields.
      • OLD CAGE CODE (Combo box)
      • OLD STATUS
      • OLD COMPANY NAME


    What I need
    After I fill in the combo box and the two other fields update on the form, I need that information to be populated on my main table.


    Thank you in advance for any help.
    Clay

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Normally a Form/SubForm arrangement is used to deal with a 1:m relationship. It sounds to me like whatever you have in the SubForm should be on the MainForm instead.

  3. #3
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    Thanks for the reply.
    The sub form is located on the main form. The only way that I knew how to add the combo box look up was to do it on a subform then add it to my main form.

    I am including a snap shot of my form in design view. Not sure that this will help but here it is.
    Click image for larger version. 

Name:	database.jpg 
Views:	7 
Size:	201.3 KB 
ID:	8552
    Attached Thumbnails Attached Thumbnails database.jpg  

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Forms are simply windows into the RecordSources of tables and queries. What is the RecordSource of your SubForm and where on the MainForm were you planning to include the additional data?

  5. #5
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    My recordsource for the subform is Cage_Code_tbl. I am attaching different screen shot of the form in form view.
    Click image for larger version. 

Name:	form view.jpg 
Views:	7 
Size:	209.8 KB 
ID:	8555

    Here is a screen shot of the main table PBOM_TABLE.
    Click image for larger version. 

Name:	PBOM TABLE VIEW.JPG 
Views:	7 
Size:	77.6 KB 
ID:	8556

    The information that I want does populate on the form. In other words, the combo box does work correctly but once the data populates on the main form, I can not figure out how to get it to the PBOM_TABLE.

    The PBOM_TABLE is where I have all my data (that's working correctly) go to so that I can build reports against the data. The form itself I use to manage the PBOM process.

    The may be to much info or the wrong information. Sorry if it is not, but I really do appreciate the the help. GREATLY.

    Clay

  6. #6
    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,726
    In "business terms" what is the relationship of the data on the Main form and that on the subform? Forget the combobox for the moment.

    As RG said you normally have a 1:M set up.
    for example, a Person(1 side) has many(M) Hobbies where Person is on MainForm and a list of his/her Hobbies is on the subform.

  7. #7
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    Hi Orange,
    As you can tell you are basically helping "Larry the Cable Guy" over here. I only have what I have taught myself and no formal training. I really appreciate everyone being patient and trying to help me.

    The main form is 1:M
    The subform is 1:2
    • Objects that the subform depends on: Cage_Code_tbl
    • Objects that depend on the subform: Main form



    So, to explain it in my terms..... The subform is only used from / on the main form and draws its data from the Cage_Code_tbl.


    I need to make a correction to my original statement

    What I have
    I have a main form that has a couple of subforms on it.


    • The subform has two fields not three. The combo box is not actually in the subform.
      • OLD CAGE CODE (Combo box) Not apart of the subform.
      • OLD STATUS (text box)
      • OLD COMPANY NAME (text box)



    The information that I put in the combo box does populate the PBOM_TABLE the way that I want it to. However, the two text box fields populate and stay on the form correctly but do not populate / move to the PBOM_TABLE correctly.

    Thanks again.

  8. #8
    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,726
    I need to make a correction to my original statement

    What I have
    I have a main form that has a couple of subforms on it.



    • The subform has two fields not three. The combo box is not actually in the subform.
      • OLD CAGE CODE (Combo box) Not apart of the subform.
      • OLD STATUS (text box)
      • OLD COMPANY NAME (text box)





    The information that I put in the combo box does populate the PBOM_TABLE the way that I want it to. However, the two text box fields populate and stay on the form correctly but do not populate / move to the PBOM_TABLE correctly.



    I'm confused. You are correcting your earlier post
    You have 2 subforms, then you say the subform.....

    Please describe exactly what you have?

  9. #9
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    Sorry about the confusion. So when I said; "I have a main form that has a couple of subforms on it", that was accurate. However, the other details are regarding only one of the subforms. One subform is difficult enough for me to describe so I figure if some one can show me how to do one, then I can apply the same logic to the other which is an exact duplicate of the first. So let me correct the statement.


    What I have
    I have a main form that has a subform on it.
    • The subform has two fields not three. The combo box is not actually in the subform.
      • OLD CAGE CODE (Combo box) Not apart of the subform.
      • OLD STATUS (text box)
      • OLD COMPANY NAME (text box)


    The information that I put in the combo box does populate the PBOM_TABLE the way that I want it to. However, the two text box fields populate and stay on the form correctly but do not populate / move to the PBOM_TABLE correctly.

    Hopefully that makes more sense. lol

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I guess I would have to ask why you have a SubForm here?

  11. #11
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    It is the only way that I know how to have data auto populate on the form.
    • The long term goal is to have the form auto populate as much data as possible so that I do not have to do it all manually.


    This is the first access data base that I have built and I have no formal training except for a couple of three day classes. I'm sure you have already guessed that. lol

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What are the ControlSources of the three controls in question?

  13. #13
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    Here are the control sources from the main form view.
    Click image for larger version. 

Name:	control source.JPG 
Views:	6 
Size:	104.9 KB 
ID:	8572

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay, now what do you have in the AfterUpdate Event of the ComboBox?

  15. #15
    dausa is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    17
    Nothing at all.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  2. Populate combo box with Record Set in Access 2003
    By ganeshvenkatram in forum Access
    Replies: 2
    Last Post: 06-20-2011, 04:10 AM
  3. Populate table/subform from VBA
    By degras in forum Forms
    Replies: 3
    Last Post: 03-03-2011, 10:59 AM
  4. Replies: 9
    Last Post: 12-15-2010, 01:44 PM
  5. Replies: 0
    Last Post: 06-23-2009, 03:01 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