Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2002
    Location
    Guernsey
    Posts
    13

    Question Unanswered: Iterating through subform objects

    Hi,

    I have a button on my main form, which, when clicked, I would like to iterate through each record in the subform (it's not a datasheet, but a tabular form) and set the checkbox for each record to be ticked (i.e. -1) but I haven't a clue how to do this!

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    Could you not set the button_click event to run an Update Query
    "Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done."

  3. #3
    Join Date
    Mar 2002
    Location
    Guernsey
    Posts
    13
    Sorry I think I had a stupid moment there, what I meant to say was; the button (in the main form) checks that all the checkboxes are ticked (by running a query in vba) and then ticks off another box (in a different table) to say the review is complete. I now want to set the checkboxes in the subforms to be locked, so the user cannot change them again, making the review incomplete, but the log of the review would still show complete.

    Hope that makes sense

  4. #4
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    is the sub form a continuous form?
    "Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done."

  5. #5
    Join Date
    Mar 2002
    Location
    Guernsey
    Posts
    13
    Yes, it's a continuous form

  6. #6
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    Sorry for the delay, I couldn't find how I did it before. firstly, you need to setfocus to something on the subform, for example we'll say the subform is called TestSub, a text box called TestText and the check box as TestCheck all on the subform, and this is the code

    Me![TestSub].Form![TestText].SetFocus
    Me![TestSub].Form![TestCheck].Enabled = False
    "Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done."

  7. #7
    Join Date
    Mar 2002
    Location
    Guernsey
    Posts
    13
    Superb. Worked a treat. Thanks!

  8. #8
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    Not a problem, glad to help.
    "Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •