Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    ListBox update subform,i.e. add products to it

    I hope someone, preferably someone who has my db already and a little familiar with it can direct me in the right path. Right now I am using 4 tables,5 forms and 4 queries for this feature. The tables are Time,Products,Categories,Orders. Queries are QAddProducts,QProductsSub,TimeCards,QTaxableMultiI temSelect and one sql statement. Forms are TimeCards,TimeCatAndProdSub,AddProducts,AddProduct sSubform,FTaxableMultiItemSelect.

    Main form is TimeCards and it has a subform on it named TimeAndCatProdSub ' used to add products to a purchase order
    AddProducts has a subform on it named AddProductsSubform ' used to add products for each category
    FTaxableMultiItemSelect form, a wish for solution to add many items at a time to TimeAndCatProdSub form on TimeCards form.



    The db is too large to post in one file so I have to break it down into 4 zips, tables,queries,forms and macros with one module
    Attached Files Attached Files

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Database Wth Added Changes

    Note; I did NOT use the implemented changes for my data structure source on the subform TimeAndCatProductsSub, it works fine the way it is for now.

    But as you can see, I did implement the changes suggested but they are separate for the time being.
    Attached Files Attached Files

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Question Trying code to update form

    This code does NOT work but am I going in the right direction? It comes from a command button on my new multiselect list box where I can select as many items as I want to, and then at least in theory put on my form TimeCardCatAndProdSub which is a subform on main form Timecards. Multiselect form is a popup form named FCatMultiSelect



    Private Sub Command5_Click()
    Dim frm As Access.Form
    Dim ctl As Control
    Dim varItem As Variant

    Set db = CurrentDb
    Set frm = Form!FCatMultiSelect 'form where product selection is made
    Set ctl = frm!TimeCardCatAndProdSub 'form that needs selected records added

    For Each varItem In ctl.ItemsSelected
    db.Execute "INSERT INTO TimeCardCatAndProdSub(Category Name)" & " VALUES (""" &
    ctl.ItemData(varItem) & """)"
    Next varItem
    End Sub


    __________________________________________________ ___________________________
    Plan B:
    Use a append query like the one I use to add at present one item at a time
    The query is named QTimeCardCatAndProdSub

    If you look at the pic I uploaded it shows what I want to happen. Main form us loaded with subform on it and popup multiselect form is open.
    Any suggestions?
    Attached Thumbnails Attached Thumbnails MultiSelectProductsApend.jpg   AppendQuery.jpg  

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    My Ideas on how to fix the problem

    They may not work but here is an attached db with my ideas of how adding multiple items at once could be implemented. View readme and code forms and then open FProductMultiItemSelect.


    Thanks,

    Dave
    Attached Files Attached Files

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    I abandoned this project.

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

Similar Threads

  1. VBA to update Products Table from excel file
    By Mclaren in forum Programming
    Replies: 2
    Last Post: 07-26-2012, 12:14 AM
  2. Replies: 8
    Last Post: 04-24-2012, 01:05 PM
  3. update team against 2nd level products
    By Lata in forum Queries
    Replies: 2
    Last Post: 09-20-2011, 03:35 AM
  4. Listbox update
    By Pgill in forum Forms
    Replies: 4
    Last Post: 07-25-2011, 11:42 AM
  5. Replies: 1
    Last Post: 03-15-2011, 03:53 PM

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