Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    41

    Unanswered: How would I do a batch update on a subform?

    I have a single form, MainForm, which has two subforms, Subform1 and Subform2, both of which are in datasheet view, and have queries as their record sources.

    When a user selects a record from Subform1, Subform2 is updated to display related information based on that item. Subform 2 has a Price column, which I would like to be updated all at once.

    This is where I'm stuck...

    Ideally, MainForm will have a textbox where the user will enter a percentage to increase or decrease by, and an Update button.

    It would also be nice to include a checkbox in Subform2, where the user can select what records to update. If it's checked, then update... otherwise leave the price as-is.

    I tried to include a Yes/No field in one of the tables that the Subform2 record source query is based on, but the recordset is not updatable due to a number of Group Bys that are needed.

    I know this requires a bunch of VBA, but the checkbox functionality is what I can't achieve.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    What have you got so far?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    May 2009
    Posts
    41
    Quote Originally Posted by StarTrekker
    What have you got so far?
    Well, the forms itself is working and it filters fine from Subform1 to Subform2. Right now, the user can click on each record individually and update the price one-by-one through a pop-up form.

    I'm just having trouble starting out with this batch update feature... where the lack of checkbox next to each record is the major hurdle before I can begin writing the code.

    I can exclude the checkbox, and only allow them to update ALL the records in Subform2, but this doesn't seem very user friendly.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I meant in the way of code ... you said you can "exclude the checkbox, and only allow them to update ALL the records in Subform2". How are you doing this? Show me the code as there should be an easy way to modify it to only include records with or without a tick.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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