fiogf49gjkf0d 1. is Form the actual name for the form object that the grid is on? Recommend you left mouse button on the actual form, F4 to show properties and then change the Name property to something special....frmMyFormName....
2. Is the 'Form' local to the script? you may not have an actual handle to the 'Form' and may need to walk the Forms Collection and get a reference to the actual 'Form' you are referring to.
Why not just say
gridname.editoptions....... why are you adding 'Form' to the reference?
3. you get a different error when you don't have an actual recordset in the grid.....
So my guess is that 'Form' is not an actual form name in the Forms collection and you don't have a valid reference to an actual forms object from the forms collection.
Sub ValidateGridEditOption(Sender) If DataGrid1.Recordset.RecordCount >0 Then DataGrid1.EditOptions.ShowDelete = False Else DataGrid1.EditOptions.ShowDelete = True End If End Sub
BTW, in our shop, you name a data grid object DataGrid1 you're out of here......just sayin'
dgProducts grdLeftAccounts, dgUpperContacts, or grdAccounts but never DataGrid1 |