Results 1 to 3 of 3

Thread: Invalid Key(tree View)

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    54

    Invalid Key(tree View)

    I have a treeview importing the data from board file on to treeview(Busnames as Paren node and Netnames as Chils nodes) .I have data which contains both Numeric and Non numeric values.Busname tracking both numeric and non numeric but netname(childnode) tracking only Charater based value but not numeric values.Its througing error as "Invalid Key" RunTime error - 35063
    The error occuring in this line.I would appreciate if you provide the solution.


    treeBusNode.Nodes.Add relative:=Bus_Name & "_Key", relationship:=tvwChild, Key:=CStr(Split(myArray(i), "!")(2)), Text:=CStr(Split(myArray(i), "!")(2))

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Invalid Key(tree View)

    Most, if not all, VB keys do not accept numeric values. There are workarounds, for example, prefixing the numeric key with an alpha character: i.e., k35063 vs 35063

    If you are concerned about whether to access your node with a prefix or not, simply prefix all keys with the same character. Stripping off the 1st character, if needed, to write the key to file is easy enough: Mid$(.Key, 2)
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width