A
Accessor
Hi all. I'm trying to write a general procedure that I can pass a form name
to to clear all text, list and combo boxes. I can't seem to pass the form as
a form, but that's another conversation. It works when I pass the form name
as a string, but I get "you can't assign a value to this object" on the first
text box. Any ideas? Here's my call:
Call ControlsClear("frmFreelanceLog")
And my sub:
Sub ControlsClear(frm As String)
'Clear all text boxes, list boxes, and combo boxes on the form passed.
Dim ctl As Control
For Each ctl In Forms(frm).Controls
If ctl.ControlType = acTextBox Then
ctl = ""
End If
Next ctl
End Sub
Thanks in advance...
to to clear all text, list and combo boxes. I can't seem to pass the form as
a form, but that's another conversation. It works when I pass the form name
as a string, but I get "you can't assign a value to this object" on the first
text box. Any ideas? Here's my call:
Call ControlsClear("frmFreelanceLog")
And my sub:
Sub ControlsClear(frm As String)
'Clear all text boxes, list boxes, and combo boxes on the form passed.
Dim ctl As Control
For Each ctl In Forms(frm).Controls
If ctl.ControlType = acTextBox Then
ctl = ""
End If
Next ctl
End Sub
Thanks in advance...