I am not new to programming, but I am new to VBA and still kind of a rookie with Access 2002. I am working with a table (oh yeah, I’m still learning the VBA/Access lingo – if anything in this post looks really weird I am probably calling it the wrong thing). The table holds info about the products that my company sells. There is a form that most of the people working with the database use to add new products, update pricing, etc. I was asked to add a checkbox to this form that will lock down the three price fields (cost, MSRP, and sale price) to prevent someone from making an accidental change. When the box is not checked, the price fields are locked; when it is checked the fields unlock. The default should be for the box to be unchecked when the form loads.
Here’s what I do have working: the fields are in fact locked when the box is unchecked and the fields unlock when the box is checked. No problem there.
This is what doesn’t work:
1) when the form loads for the first time the checkbox is ‘grayed out’ and the fields are not locked. If you check on the box it starts working and the fields lock and unlock the way I want them to. How do make the checkbox assume the unchecked state when the form loads?
2) I want the checkbox to revert back to the unchecked state when the user moves to the next record. For example, someone is looking at record 103 and checks the box to change the price. They then move on to record 104 without unchecking the pricelock box in 103. When they return to record 103 I want the checkbox to be unchecked. Ideally this checkbox update should happen when the user leaves record 103, not when they return to the record.
Hope this makes sense and I hope someone out there can help. Thanks in advance for your help!
Here’s what I do have working: the fields are in fact locked when the box is unchecked and the fields unlock when the box is checked. No problem there.
This is what doesn’t work:
1) when the form loads for the first time the checkbox is ‘grayed out’ and the fields are not locked. If you check on the box it starts working and the fields lock and unlock the way I want them to. How do make the checkbox assume the unchecked state when the form loads?
2) I want the checkbox to revert back to the unchecked state when the user moves to the next record. For example, someone is looking at record 103 and checks the box to change the price. They then move on to record 104 without unchecking the pricelock box in 103. When they return to record 103 I want the checkbox to be unchecked. Ideally this checkbox update should happen when the user leaves record 103, not when they return to the record.
Hope this makes sense and I hope someone out there can help. Thanks in advance for your help!