-
Hi Hansup,
You replied stating to use 'SetFocus'. Would you please elaborate a little more with some procedural steps to execute.
I have reviewed your code and have the following understanding. Please correct me if I am wrong.
[VBA]Private Sub Form_Current()
SetEnabledFields 'calls the procedure below'
End Sub
Private Sub SetEnabledFields()
Select Case Fix(Me.cboAct.Value)
'I assume the subform disables the three fields in CASE ELSE
Case 1
'The two fields below are enabled of the three that were disabled
Me.txtStartDepth.Enabled = True
Me.EndDepth.Enabled = True
Case 2
'The field below is enabled of the three that were disabled
Me.txtQuantity.Enabled = True
Case Else
Me.txtStartDepth.Enabled = False
Me.EndDepth.Enabled = False
Me.txtQuantity.Enabled = False
End Select
End Sub [/VBA]
It is my understanding that the 'Case Else' statement handles which fields are disabled on subform load. In the code above, it is those three fields. Is this correct?
It is my understanding that those three fields (in Case Else) toggle between enabled and disabled when the cboAct value is 1 or 2.
So, in summary, I assume that I only have to declare which fields I want as disabled on subform load in the Case Else section and those that I want enabled in Case 1 or 2 or 3,4,5,6, etc.
Thanks for your help so far.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules