Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

function or interface marked as restricted or the function uses an automation type not supported in visual basic

I get the follow error:
"function or interface marked as restricted or the function uses an automation type not supported in visual basic"

when running this code:
        For i = 1 To 14
        StateWide.Controls("Check" & i) = rec.Fields(("StateWideCheck" & i))
        Next i

Why doesn't Controls("Check" & i) work in vb6?
Avatar of jkaios
jkaios
Flag of Marshall Islands image

What type of control is "StateWide"?  Is it a form?

One of the following scenarios may be true:

  1) StateWide doesn't have a property called "Controls"

  2) the "Controls" property of object StateWide does not support string as in "check"

  3) try StateWide.Controls(i) instead
Avatar of al4629740

ASKER

It is a form
Maybe try explicitly stating the properties you are wishing to call the setter/getter for rather than using the default property?

StateWide.Controls("Check" & i).Text = rec.Fields(("StateWideCheck" & i)).Value

Open in new window


--
Chris
SOLUTION
Avatar of jkaios
jkaios
Flag of Marshall Islands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial