Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Looping through records on a subform

    On a form, I have a subform which contains line items. Their is a checkbox for the user to select the line items that need to be saved. How do I loop through those line items to determine if it has the checkbox selected? Thank you in advance

  2. #17
    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
    Use a .MoveNext Loop on the RecordsetClone until .EOF.

  3. #18
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    OK. I'll work through your suggestion.

    My using the checkbox has a problem, when I click on the first checkbox, it places a check within each box. Did I do something wrong or should I use another method for selecting the line items?

  4. #19
    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
    You may have a problem here. In order for a CheckBox to be unique on each record it would need to be bound to a field in the Recordset of the form. It is why I was thinking about ListBoxes early in this thread but we were concentrating on getting the Link fields working first.

  5. #20
    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
    Here's a demo of what I had in mind for the SubForm. I'm afraid I don't remember where I got this or who to credit with the code but it is not mine.

  6. #21
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Those look nice and very functional. I don't know if they'll work for me. In addition to selecting the record, their are two additional fields of info that the user will enter.

  7. #22
    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
    OK, then how about one ListBox and one SubForm in continuous form view?

  8. #23
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    my recordsource for my subform is a query containing fields from two ODBC linked tables. Does that provide me any options?

  9. #24
    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
    Since you cannot modify them it poses a problem. The CheckBox idea needs an updateable recordset. The ListBox idea does not.

  10. #25
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    OK. I'm unclear on what you mean. Can you get me started? I've attached a zipped file with the tables and forms I've created

  11. #26
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I'm thinking outside the box. Ultimately, for each record within ICPOLineItems, their will be a record within tblProductPrintRunRecord. What if when the main form is opened, it appends to tblProductPrintRunRecord any new records within ICPOLineItems. Then I could use tblProductPrintRunRecord as the recordsouce for the subform. I realize this is not best for data normalization, but I'm limited right now.

  12. #27
    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
    When you are stuck with RecordSources that cannot be altered, sometimes you have to put the rule book aside and just make it work. Give it a try. I have to go do a task for an hour or so right now. I'll check back in when I return.

  13. #28
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. I appreciate all your help. I wouldn't be where I am without you. I'll let you know what I figure out.

  14. #29
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thinking outside of the box worked greated. Thanks again for all your assistance!!

  15. #30
    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
    That's great! Thanks for posting back with your success.

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

Similar Threads

  1. selecting Sub-Form data from two inputs
    By techexpressinc in forum Queries
    Replies: 19
    Last Post: 12-03-2010, 11:03 AM
  2. Replies: 5
    Last Post: 04-01-2010, 03:48 PM
  3. Selecting multiple records in drop down
    By rscott7706 in forum Access
    Replies: 1
    Last Post: 08-26-2009, 03:00 PM
  4. Problem Selecting Records for a Report
    By Joe in forum Programming
    Replies: 0
    Last Post: 09-27-2008, 02:27 PM
  5. Replies: 1
    Last Post: 03-17-2006, 12:04 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