B
BMoroneso
I want to lock all the data fields in a form when I open it, leaving only the
filter combo boxes available for use.
Three of the data fields are combo boxes (InsurerID, TypeID, and ProdCatID).
The code I've used is below.
DoCmd.OpenForm "frmProducts", acNormal, "", "", , acNormal
Forms!frmProducts.ProductName.SetFocus
Forms!frmProducts!InsurerID.Enabled = False
Forms!frmProducts!TypeID.Enabled = False
Forms!frmProducts!ProdCatID.Enabled = False
Forms!frmProducts!ProductName.Locked = True
Forms!frmProducts!DateIntroduced.Locked = True
Forms!frmProducts!DateRetired.Locked = True
Forms!frmProducts!frmCommSetup.Locked = True
The enabled = false setting works for the first two combo boxes, but not the
third, and the locked = true setting doesn't work for any of them. The error
message returned is "Object doesn't support this property or method." But,
everything I have read online and in books says it should work with no
problems...
Any advice is appreciated!!
filter combo boxes available for use.
Three of the data fields are combo boxes (InsurerID, TypeID, and ProdCatID).
The code I've used is below.
DoCmd.OpenForm "frmProducts", acNormal, "", "", , acNormal
Forms!frmProducts.ProductName.SetFocus
Forms!frmProducts!InsurerID.Enabled = False
Forms!frmProducts!TypeID.Enabled = False
Forms!frmProducts!ProdCatID.Enabled = False
Forms!frmProducts!ProductName.Locked = True
Forms!frmProducts!DateIntroduced.Locked = True
Forms!frmProducts!DateRetired.Locked = True
Forms!frmProducts!frmCommSetup.Locked = True
The enabled = false setting works for the first two combo boxes, but not the
third, and the locked = true setting doesn't work for any of them. The error
message returned is "Object doesn't support this property or method." But,
everything I have read online and in books says it should work with no
problems...
Any advice is appreciated!!