I use the below code to filter and modify my form based on the selection in a combo box:
If Me.CboShowMe = "Current Employees" Then
DoCmd.ApplyFilter , "isNull(TerminationDate)"
Screen.ActiveDatasheet.PostLocation.ColumnWidth = 0
Screen.ActiveDatasheet.PostedDate.ColumnWidth = 0
Screen.ActiveDatasheet.TerminationDate.ColumnWidth = 0
Screen.ActiveDatasheet.Position.ColumnWidth = 0
End If
The problem is that I am unable to get this code to work in the On Load or On Open events (I want this above setting to be the default when the form opens). When I attempt to use this code in On Open or On Load I get errors with the Screen.ActiveDatasheet command. Any Ideas