Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    data type variable constants

    I'm having a conflict passing the correct data type to a function


    every thing tells me that the type is correct, but it gets rejected... (should be a string)

    so I added this line of code: (LinkLocation is a valid function, and vFilePath is the variable whose data type I'm lookng for)

    vFilePath = linklocation("tbeFixtureTypeDetails")
    MsgBox VarType(vFilePath)


    the result is ' 8 '

    what does 8 mean? what type of data is that? I,ve searched, maybe not very well, but find nothing?

    is there a differnt function that will give me a less kryptic answer?
    does anyone have a table of numeric vb constants for data types?

    thanks in advance
    Mark

  2. #2
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    Constant Value Description
    vbEmpty 0 Unitialized variable
    vbNull 1 No valid data
    vbInteger 2 Integer
    vbLong 3 Long integer
    vbSingle 4 Single-precision number
    vbDouble 5 Double-precision number
    vbCurrency 6 Currency
    vbDate 7 Date
    vbString 8 String
    vbObject 9 Object
    vbError 10 Error value
    vbBoolean 11 Boolean
    vbVariant 12 Variant
    vbDataObject 13 Data Access Object
    vbDecimal 14 Decimal
    vbByte 17 Byte
    vbLongLong 20 LongLong integer (only 64-bit platforms)
    * Access 2010
    vbUserDefinedType 36 User-defined type
    vbArray 8192 Array

  3. #3
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    Quote Originally Posted by markjkubicki View Post
    I'm having a conflict passing the correct data type to a function
    every thing tells me that the type is correct, but it gets rejected... (should be a string)

    so I added this line of code: (LinkLocation is a valid function, and vFilePath is the variable whose data type I'm lookng for)

    vFilePath = linklocation("tbeFixtureTypeDetails")
    MsgBox VarType(vFilePath)


    the result is ' 8 '

    what does 8 mean? what type of data is that? I,ve searched, maybe not very well, but find nothing?

    is there a differnt function that will give me a less kryptic answer?
    does anyone have a table of numeric vb constants for data types?

    thanks in advance
    Mark
    ummm...why are we doing this?

    8 is the representation of an enumeration value that visual basic uses to index the data type in a larger-grouped set of "stuff". the compiler doesn't see "vbString", it sees 8, or rather its binary equivalent. but Microsoft thinks it's easier for programmers to read something closer to English, which is why you have the enumeration representations for programming purposes and the actual integer values as returns when you ask visual basic about the data type. return values are never strings, always the enumeration value assigned. so if you want to be able to understand the return given you have to write you own conversion UDF.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 07-22-2014, 08:29 AM
  2. variable uses automation type not supported
    By eerkut in forum Programming
    Replies: 4
    Last Post: 02-15-2012, 03:21 PM
  3. Fill data entry textbox with variable
    By broecher in forum Forms
    Replies: 6
    Last Post: 11-18-2011, 07:54 PM
  4. Replies: 2
    Last Post: 03-18-2010, 08:24 PM
  5. Replies: 2
    Last Post: 01-25-2010, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums