Remove data from a field

rainbows

Registered User.
Local time
Today, 14:14
Joined
Apr 21, 2017
Messages
428
the form below lets me select consumables to purchase with ticking the purchase field and pressing the button called " purchase consumables " what i need to be able to do is remove the ticks after the parts have been moved to the order form at the same time. is that possible

thanks steve



1668974742312.png
 
Last edited:
Add a line to the click event of the button to update the Purchase field to False:
Code:
CurrentDb.Execute "UPDATE tblYourTable Set Purchase=False Where Purchase=True" 'might need to add extra criteria such as a reference to current record ID'
And then refresh the subform.
Cheers,
 
Your method won’t work in a multi user environment if there is a chance 2 or more users are entering this data at the same time.
 
It would if you restrict it by record\order id as mentioned in the code comments, unless multiple users are working on the same order....
 
Ah didn’t see the comments on my phone
 
thank you. all working ok just for info , only one person will have access to purchasing
 
thank you. all working ok just for info , only one person will have access to purchasing
I guess you've never heard of defensive programming. It's like defensive driving. This is a very bad solution that breaks if the users do something unexpected.
 
Question: Could it be done by using the recordsetclone?
 
In multi-user operation, however, the use of bound CheckBoxes is already the problem, the consequences of the update query are only a derived problem.

Solution: The ID's of the selected records are entered in an additional table (local table or table in the backend with additional user identification). You can then work freely with it, and like to combine related actions in one transaction.
 

Users who are viewing this thread

Back
Top Bottom