D
Doug Vernon
I tried to use the following code to clear the text boxes
(controls) on a custom dialog box:
********************
Private Sub cmdReset_Click()
On Error GoTo ResetError
Dim Frm As Form, Ctl As Control
Set Frm = Me
For Each Ctl In Frm
Ctl.Value = Null
Next Ctl
ResetError:
If Err = 2119 Or Err = 438 Or Err = 2448 Then
Resume Next
ElseIf Err > 0 Then
MsgBox Err & ": " & Err.Description
End If
End Sub
********************
When I try to debug/compile the code, I get an error
message that says "Compile Error: Invalid use of Me
Keyword".
Any help would be appreciated. dv
(controls) on a custom dialog box:
********************
Private Sub cmdReset_Click()
On Error GoTo ResetError
Dim Frm As Form, Ctl As Control
Set Frm = Me
For Each Ctl In Frm
Ctl.Value = Null
Next Ctl
ResetError:
If Err = 2119 Or Err = 438 Or Err = 2448 Then
Resume Next
ElseIf Err > 0 Then
MsgBox Err & ": " & Err.Description
End If
End Sub
********************
When I try to debug/compile the code, I get an error
message that says "Compile Error: Invalid use of Me
Keyword".
Any help would be appreciated. dv