Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

if a chr = a then move it to b if b then c

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aWs - 26 Sep 2005 23:13 GMT
I am working with a treeView.  Tree view keys must start with an alpha
charactor and does not allow you to use the same key twice in the treeview.

My key field is a numeric field that I am appending an "a" to  like this:

set treekey = "a" & strTreeKey

becuase my tree can have duplicates, I pick up the error and change the "a"
to "b" with a statement in my err trapping like this:

 if left(treekey,1) = "a" then
    treelkey = "b" & strTreekey
 elseif left(treekey,1) = "b" then
    treelkey = "c" & strTreekey
and keep repeating the logic at least until I get to i.

Is there a way to test a alpha value and then get the next letter?

 
Baz - 26 Sep 2005 23:24 GMT
> I am working with a treeView.  Tree view keys must start with an alpha
> charactor and does not allow you to use the same key twice in the treeview.
[quoted text clipped - 13 lines]
>
> Is there a way to test a alpha value and then get the next letter?

some_character = Chr(Asc(some_character) + 1)

You might want to give some thought to the case where some_character = "z",
though...
aWs - 27 Sep 2005 18:38 GMT
Thank you.  It was the nugget I was looking for.  There is an outside chance
the program my go past "z" so if that happens I have it starting again at "A".

Treeview treats case differances as separate keys

> > I am working with a treeView.  Tree view keys must start with an alpha
> > charactor and does not allow you to use the same key twice in the
[quoted text clipped - 20 lines]
> You might want to give some thought to the case where some_character = "z",
> though...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.