Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

selecting multiple records in a subform to change at once

This come off of a related question.  I am using a cmd button to change the "status" field of a record located in a subform.  However, I would like to be able to select multiple records to change at once.  Is this possible?
0
LadyHagood
Asked:
LadyHagood
  • 4
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
It's difficult to determine which records in a subform are selected; the simplest way is to use a Checkbox, and allow the user to select which records are to be handled. This way, there is no confusion, and this is a common interface consideration. Users are accustomed to it, and don't have to worry with holding down the Shift or Alt or Ctrl key ... also, this makes selecting non-contiguous records much easier.
0
 
LadyHagoodAuthor Commented:
My subform is as a datasheet, not a continuous form.  Can i still use checkbox. How would I do this. Thanks so much. LSM
0
 
LadyHagoodAuthor Commented:
ok.  I got the checkbox in there.  Now let me try.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LadyHagoodAuthor Commented:
I am able to select the records that I want to change, however when i run the command, only the last record taht I selected changes.  How can I apply the code to ALL records that have Check42 checked? Thanks for all your help.  i have increased the point value as a result.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Assuming you're running an Update query, you'd just include a WHERE clause:

UPDATE SomeTable SET SomeField=SomeValue WHERE Check42=True

Note also that you will want to clear that table when you are finished with the operation, or when the user closes the form:

UPDATE SomeTable SET Check42 = False
0
 
LadyHagoodAuthor Commented:
I was not using a query but i like that approach better that what i was attempting to do.  If I use an update query prob is there are rules that must be followed. For example, if the selected record(s) have a status of "creation" then the status must go through the appropriate stages of creation > review>approval > Distribution.  It can not be changed to "distribution" from "creation".  Would I be able to write the query in vba and  still implement these restrictions?  I am not familiar with using queries in vba so if you could give as much guidance as possible.  I've kinda shyed away from it until now i guess i have to get used to it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now