2

The Scenario
I have figured out how to lock a subform's rows (ALL) using a button and VBA code. However, I have a little extra tidbit I would like the button to perform. I have 40 choices in my combobox. Once I select the first and enter data in fields in the subform below it, I would like the button to lock those rows.

The Goal
When I select the next option in my combobox, I would like those to be editable until I click the lock button, and so forth. Is this possible?

The Code
This is currently what I have for the button:

If Me.fsubtitles!Priority.Enabled = False Then
    Me.fsubtitles!Priority.Enabled = True
Else
    Me.fsubtitles!Priority.Enabled = False
End If

Any thing else I need to provide?

Thanks!

Newd
  • 2,174
  • 2
  • 17
  • 31
  • Take a look at the following article... it explains how to use conditional formatting to lock controls ... http://stackoverflow.com/questions/11507151/enabling-and-disabling-controls-on-a-continuous-subform-in-access-2007-2010 – Wayne G. Dunn Feb 01 '17 at 16:08
  • You don't need to specify the rule at run time. Just set it once, then it will work for all rows. To use Conditional Formatting: (1) Right click on the control, (2) Select 'Conditional Formatting'; (3) Click 'New Rule'; (4) Use 'Field Value Is' and 'not equal to' and in the 3rd field, use the 'builder' to select your ComboBox. and finally click the 'enable' icon (just to right of font color). – Wayne G. Dunn Feb 01 '17 at 16:36
  • Tried that. It essentially just locks my combo box (when conditional formatting is applied to combo box...as I can't use conditional formatting on my button). My other thought may be to implement some more vba where the titles will be placed in an array based on a particular fund code or something. – Travis Cowart Feb 01 '17 at 16:58
  • No, no. Use conditional formatting on the 'Priority' field .. not the combobox. I just did this and when I select a value from the combobox, only fields containing that value can be edited. – Wayne G. Dunn Feb 01 '17 at 17:23

0 Answers0