I am using W7 and A2007. I have 8 look alike subforms as part of several parent forms. When certain fields are updated on a subform, I would like some code to be activated. One of the simple procedures is:
If (IsNull(Me.Sort) Or Me.Sort = 0) Then
Me.Sort = Me.MaxSort
End If
It works fine in the subform. When I try it In a module:
With Screen.ActiveForm
If (IsNull(.Sort) Or .Sort = 0) Then
.Sort = .MaxSort
End If
End With
I get error 2465 “Application defined or object-defined error.”
The compiler doesn’t show any problem.
Can someone tell me what I am doing wrong? Couldn’t find answer with Google or here. Any help much appreciated.