Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102

    Form not adding items to record list on subform

    This is kind of a re-post, but I have been fighting with this for 3 solid days now, and I have tried what few things I know several times. Any help would be appreciated.



    I have a form bound to a query that I am using to add items to a list of assigned equipment for each employee.
    I have a combo box that allows me to chose which employee's record I am dealing with, and 2 cascading combo boxes that allow me to chose first a category, then a size/description of the item I am wanting to add.

    after the final item is chosen, there is a button to add the items to the employee's list, and a sub form that SHOULD immediately show the new item being added to the overall list. everything [mostly] works, but the button adds the item to the correct table, but does not update the list (on the sub form) even though I am requerying the subform.

    I am attaching the db in case anyone wants to take a look. the form I am having trouble with is "frmAttempt" (as in "...ATTEMPTing to make this stupid form work")

    ps. please feel free to phrase your responses as if you are speaking to a complete dolt, because after fighting with this for 3 days, that's how I am feelin'

    thanks, mike
    ALSEWorking.zip

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    On your forms, name your combo boxes with meaningful names.
    What does frmAttempt mean/represent ---use meaningful names.
    On your frmCrewMembers what does last4 mean?

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps this thread is associated with this other thread you started? Is the previous thread resolved?
    https://www.accessforums.net/forms/c...orm-55874.html

  4. #4
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    not really, no. I tried going a slightly different way with it. neither one is getting me where I need to be, but I am still hoping for some kind of valuable advice in either direction.

  5. #5
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    OK, Thanks, I will keep that in mind.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Is it possible for you to create a Query Object that will perform at least part of what you are trying to accomplish? I suggest hardcoding some values in an append query and saving it. For instance, append a record to a table and assign a couple of the columns with values like 5 or foo.

    With that, you can use the SQL generated by your SQL object or replace the hardcoded values with your form name(s) and combo name(s).

  7. #7
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    i am not really seeing where that would get me: the main form is adding the new record to the underlying table just like i am wanting it to.

    the problem seems to be updating the info on the sub form after it is added.

  8. #8
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    the problem seems to be updating the info on the sub form after it is added.
    What exactly is the problem?

  9. #9
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    I am using a set of two cascading combo boxes on frmAttempt to add an item to a list on a sub form. the second of the 2 combos selects a productID from a list of products. The click event of a button on the form should save the new item to the list of items for the selected employee (and as far as i can tell, it does). i then need the subform to update/requery and to show the item that was just added to the list. The problem is that I can not get it to do that.

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    It is common to imagine the result desired without being able to create abstract ideas that represent the various steps that will get you there. This is something we all struggle with and it takes experience to get it right.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Check the master/child link properties of the subform control. They would prevent the subform showing anything on a new record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    Currently, I have the link master set to the combo box on the main form that allows me to chose the employee name (whose record will appear in the sub form). and the child set to the crewID (foreign key) which is how the underlying query links to the table list of employees on the sub form.

    My thought process was that was the way to link the selection on the main form to the list displayed on the sub form (if that makes any sense), and how the query/table would recognize which employee was having an item added to it... and it made sense at the time, but I have been wrong once or twice before.

  13. #13
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    Update: what i have going on now is that when the button control is clicked, the selected item IS added to the list as a new item, but if i try to add another item, AFTER that, it over writes the previous item. it doesn't seem to be moving to a new record, just over writing the previous item added.

    the click event for the button is currently set up as a macro (would like to change it to VBA, i was just experimenting with it)
    the macro does the following:

    run menu command save record
    goto record, object type (tbleAssigned), new
    requery subAttempt (which is the sub form that shows the list on the main form)

    i don't know if this does anything for anyone

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    I'm not seeing that behavior. I can add multiple records via the button.

    Regarding the links, they are for keeping the subform in sync with the main form. With them on, when you go to a new record, there's nothing in combo31, so the subform is empty (in sync with the combo). In other words, with the links you've said you only want the subform displaying records related to the person in combo31.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    That's correct, I am only wanting the records for the person selected in combo31 to appear in the sub, but then I need to have the functionality to add new records to the list of what is assigned to that person.

    the part about the macro was behavior due to some changes I made after the original post. that macro wasn't in what I posted. (I would prefer not to do anything with macros anyway, it was just an experiment)

    again, I am going back and looking at the version that I have posted above, and it isn't doing anything. it isn't adding to the table, and it isn't displaying anything in the sub form. in fact, when I click the button, all of the fields except combo38 go blank.

    I have no idea why this is giving me so much trouble, it seems like adding a new record to a table and having that new record show up on a list should be pretty basic stuff. I must be doing something pretty fundamentally wrong, and I am probably doing more harm than good to this thing, and I apologize.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-14-2015, 07:48 AM
  2. Replies: 6
    Last Post: 08-22-2012, 03:24 AM
  3. Replies: 4
    Last Post: 03-14-2012, 10:08 AM
  4. Replies: 2
    Last Post: 12-07-2011, 02:51 AM
  5. Replies: 2
    Last Post: 05-11-2011, 02:58 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