Link to home
Start Free TrialLog in
Avatar of edel2000ie
edel2000ie

asked on

What type of object

I am passing a variant to a procedure. In the procedure I want to find out what type of an object I have passed. I am passing textboxes, combo boxes and datepickers. Each are handled slightly differently in the procedure. I know the is a function to tell what kind of object something is. What is it and will it work in this case.

Edel
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

debug.print typename(object)

or

if typeof object is textbox then
end if
Avatar of corvanderlinden
corvanderlinden

Vartype(object)

Returns an Integer indicating the subtype of a variable.


Sorry, VarType is not the right one in this case

Use crazyman's TypeOf
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of edel2000ie

ASKER

Thank you Tim Cottee. Excellent answer. I was going with Typeof but your example suits perfectly. All help from everyone much appreciated

Bye

Edel