Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 549407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:10:53+00:00 2026-05-13T11:10:53+00:00

Is there a way to determine the Object type, when passing a reference to

  • 0

Is there a way to determine the Object type, when passing a reference to a function?

I’m using a security permissions function, which determines if the user has permission to view/edit the Form passed to it by reference. I’d like to expand this to include reports as well.

To keep the function generic, I’d like to pass a ref for either a Form or a Report as an Object, eg:
function gfSecurity_Permission(obj as Object)

However, I’d need to determine the type of the object within the function.

Does anyone know of a way to do that?

MTIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:10:53+00:00Added an answer on May 13, 2026 at 11:10 am

    VBA has two functions: TypeName and TypeOf (TypeOf does not have a VBA documentation article, but the function exists nonetheless).

    However, for a good example of their use, you can refer to the Determining Object Type article from the VB.NET documentation.

    Generic object variables (that is, variables you declare as Object)
    can hold objects from any class. When using variables of type Object,
    you may need to take different actions based on the class of the
    object; for example, some objects might not support a particular
    property or method. Visual Basic provides two means of determining
    which type of object is stored in an object variable: the TypeName
    function and the TypeOf…Is operator.

    TypeName and TypeOf…Is
    The
    TypeName function returns a string and is the best choice when you
    need to store or display the class name of an object, as shown in the
    following code fragment:

    Dim Ctrl As Control = New TextBox  
    MsgBox(TypeName(Ctrl))
    

    The TypeOf…Is operator is the best choice for testing an object’s
    type, because it is much faster than an equivalent string comparison
    using TypeName. The following code fragment uses TypeOf…Is within an
    If…Then…Else statement:

    If TypeOf Ctrl Is Button Then  
        MsgBox("The control is a button.") 
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can programatically discover more than you ever wanted to… May 16, 2026 at 9:04 am
  • Editorial Team
    Editorial Team added an answer Try handling PreviewKeyUp (or KeyUp) instead. If that does not… May 16, 2026 at 9:04 am
  • Editorial Team
    Editorial Team added an answer I have been dealing with the same challenge for the… May 16, 2026 at 9:04 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Is there any way to determine if an object is a generic list? I'm
In Ruby, is there a way to determine the name of a method, akin
I'm using the SharePoint 2007 object model API to assign a role to a
I'm attempting to create a function where I can pass names and values that
I was just reading this thread and it occurred to me that there is
First, I'm aware of this question , and the suggestion (using GUID) doesn't apply
Ok, so I'm using Objective-C. Now, say I have: TopClass : NSObject - (int)
I am trying to write a function in C# that will take two small
I have a few procedures, for simplicity sake, look like the following: public string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.