J
JIM
Hi, here is code i'm using on the On Load event of my subform:
Private Sub Form_Load()
If CurrentProject.AllForms("frmClientBuildings").IsLoaded Or Parent.Name
= "frmWorkOrders" Then
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Static" Then ctl.Enabled = False
Next ctl
Else
If Parent.Name = "frmCustomer" Then 'allow edits if subform of
frmCustomers
Me.AllowEdits = True
Me.AllowAdditions = True
End If
End If
End Sub
If subform is loaded alone or is a subform of frmWorkOrders I don't want
user to have ability to edit certain fields. If subform is a subform of
frmCustomers then I want all fields enabled in order to edit. The problem
with this method is in form view all the controls that have Tag="Static" are
greyed out. I did a search on locked and other words but can't find another
word to use other than enabled. Is there another way to accomplish?
Private Sub Form_Load()
If CurrentProject.AllForms("frmClientBuildings").IsLoaded Or Parent.Name
= "frmWorkOrders" Then
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Static" Then ctl.Enabled = False
Next ctl
Else
If Parent.Name = "frmCustomer" Then 'allow edits if subform of
frmCustomers
Me.AllowEdits = True
Me.AllowAdditions = True
End If
End If
End Sub
If subform is loaded alone or is a subform of frmWorkOrders I don't want
user to have ability to edit certain fields. If subform is a subform of
frmCustomers then I want all fields enabled in order to edit. The problem
with this method is in form view all the controls that have Tag="Static" are
greyed out. I did a search on locked and other words but can't find another
word to use other than enabled. Is there another way to accomplish?