50/50 Chance of Working

TheSearcher

Registered User.
Local time
Today, 05:37
Joined
Jul 21, 2011
Messages
392
I've noticed that the following code is problematic. Sometimes it works and sometimes it produces the "object doesn't support this property or method" error.
Does anyone know why this would be?
Code:
dim ctl as control
For Each ctl In Me.Controls
    If ctl.Tag = "clear" Then ctl.Value = Null
Next
 
Watch out for other things that ALSO don't have .Value - like command buttons, lines, images, etc.
 
And I thought perhaps some objects don't have a tag property. Wouldn't it be nice if the error message included the property that didn't exist?
 
Labels have Tag property but not Value. So far, don't see any regular Access controls without Tag.
If control's property does not have "clear", code should work, unless form includes ActiveX controls.

I have a form with two Web Browser controls, each with different properties - one has Tag and other does not. I think the one without is an ActiveX control. Form also has Windows Media Player and this is an ActiveX as well and no Tag property.
 

Users who are viewing this thread

Back
Top Bottom