Update Rows Where Checkbox = True in Subform

Adam McReynolds

Registered User.
Local time
Today, 12:35
Joined
Aug 6, 2012
Messages
129
I have a sub form which I use to update data in a table if the user selects the check box. This works fine except that I want to make sure that the user selects a button on the main form, so I want to update those records which have been selected on the sub form with a "Report Created" in my [DeliveryReportStatus] field in the main table, when the user clicks the button on the main form.

I can get it to update a single record, but not all of the check box selected records. I tried an update query but I have had trouble getting it to work. I have also seen some code using a loop of some type on the record set but I do not understand it.

Hopefully someone can push me in the right direction. Any help is appreciated.
 
What problem did you've with that? My solution would be to use such a query!

Thanks for the reply. I had trouble getting the query to look at my sub form with the criteria. I have made select queries before using the "Forms" method to hold criteria from another form, but for some reason I could not figure out how to get it to only look if the the check box is true and the status = "Delivered".

Then I did not know what way I am supposed to run the update query. I just want it to run for what is on my current sub form, it seems like when I was trying it, it was running for everything in my table that has the check box = true and delivered, and not just my current sub form that is on the screen. Thanks again.
 
Thanks for the reply. I had trouble getting the query to look at my sub form with the criteria. I have made select queries before using the "Forms" method to hold criteria from another form, but for some reason I could not figure out how to get it to only look if the the check box is true and the status = "Delivered".
I would create the SQL-string on the fly and run it when you press the button in the main form.
Then I did not know what way I am supposed to run the update query. I just want it to run for what is on my current sub form, it seems like when I was trying it, it was running for everything in my table that has the check box = true and delivered, and not just my current sub form that is on the screen. Thanks again.
Then you've not got all the required criteria in it, to identify the records!
If you can't get it post your database with some sample data + the name of the form in which you've the problem!
 

Users who are viewing this thread

Back
Top Bottom