473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

TreeView Wierdness

I put this up on microsoft.public.access earlier today, but no nibbles.

I'm loading a TreeView and it's trapping out on a duplicate node error... but
with the same data, it traps out on different input records and I'm totally at a
loss.

Tried writing .NodeKey to a text file before every insert - and there really
doesn't seem tb any duplication going on.

I reduced it all to a mini application.

In the mini app the problem acquires a little extra twist, though. When it
traps out in the load routine and the error trapping kicks in; control
immediately returns to the button Click() routine that calls it. So you have
to put a breakpoint in on the load routine's error trap to see the actual Erl
and Error$ values.

If anybody's feeling bored or masochistic, I would be most grateful if they
could take a look at this thing.

You can download the mini application by clicking http://tinyurl.com/nd4rc

It's about 400k zipped.
--
PeteCresswell
Sep 26 '06 #1
5 1998
On Tue, 26 Sep 2006 19:11:34 -0400, "(PeteCresswell)" <x@y.Invalid>
wrote:

I looked at it a bit. Not sure yet what's up but I noticed:
*1: When I changed the procedure declaration to ByRef theTree As
MSComctlLib.TreeView (because I thought "as Control" was sloppy and
didn't give me intellisense), I got an error calling the proc.

*2: 1961 With theTree 'TvS commented out
1962 .Font = "Courier New"
1969 End With
Commented this out because the Font property (with *1 in place) does
not take a string arg.

More perhaps later.

-Tom.
>I put this up on microsoft.public.access earlier today, but no nibbles.

I'm loading a TreeView and it's trapping out on a duplicate node error... but
with the same data, it traps out on different input records and I'm totally at a
loss.

Tried writing .NodeKey to a text file before every insert - and there really
doesn't seem tb any duplication going on.

I reduced it all to a mini application.

In the mini app the problem acquires a little extra twist, though. When it
traps out in the load routine and the error trapping kicks in; control
immediately returns to the button Click() routine that calls it. So you have
to put a breakpoint in on the load routine's error trap to see the actual Erl
and Error$ values.

If anybody's feeling bored or masochistic, I would be most grateful if they
could take a look at this thing.

You can download the mini application by clicking http://tinyurl.com/nd4rc

It's about 400k zipped.
Sep 27 '06 #2
On Tue, 26 Sep 2006 19:07:09 -0700, Tom van Stiphout
<no*************@cox.netwrote:

Got it. The key "TrancheRec57" is duplicated, and line 1406 fails
because of it.

To determine this, I commented out your error handler and replaced it
with:
Msgbox Err.Description
Resume
and put a breakpoint there.

Also, following up on my previous message, this is how I call the
procedure:
K = DealTreeLoad_ByDeal(False, Me.treDeal.Object, mCurNode)
and this is how I declare it:
Public Function DealTreeLoad_ByDeal(ByVal theExpandAllSwitch As
Boolean, ByVal theTree As MSComctlLib.TreeView, ByVal thePrvRootNode
As MSComctlLib.Node) As Long

Regards,

-Tom.
>On Tue, 26 Sep 2006 19:11:34 -0400, "(PeteCresswell)" <x@y.Invalid>
wrote:

I looked at it a bit. Not sure yet what's up but I noticed:
*1: When I changed the procedure declaration to ByRef theTree As
MSComctlLib.TreeView (because I thought "as Control" was sloppy and
didn't give me intellisense), I got an error calling the proc.

*2: 1961 With theTree 'TvS commented out
1962 .Font = "Courier New"
1969 End With
Commented this out because the Font property (with *1 in place) does
not take a string arg.

More perhaps later.

-Tom.
>>I put this up on microsoft.public.access earlier today, but no nibbles.

I'm loading a TreeView and it's trapping out on a duplicate node error... but
with the same data, it traps out on different input records and I'm totally at a
loss.

Tried writing .NodeKey to a text file before every insert - and there really
doesn't seem tb any duplication going on.

I reduced it all to a mini application.

In the mini app the problem acquires a little extra twist, though. When it
traps out in the load routine and the error trapping kicks in; control
immediately returns to the button Click() routine that calls it. So you have
to put a breakpoint in on the load routine's error trap to see the actual Erl
and Error$ values.

If anybody's feeling bored or masochistic, I would be most grateful if they
could take a look at this thing.

You can download the mini application by clicking http://tinyurl.com/nd4rc

It's about 400k zipped.
Sep 27 '06 #3
Per Tom van Stiphout:
>Got it. The key "TrancheRec57" is duplicated, and line 1406 fails
because of it.
But is it *really* duplicated? That's the crux of my problem. I put in a
line of coding above 1406 to write the key value to a text file and it didn't
look to me like it was being duplicated.

I'll throw up another version of the standalone with that coding in it.

Thanks for the pointer on declaring the object so as to get IntelliSense
working. Being clueless, I just wimped out with the "Control" declaration.
I think I'll go back over the code in some of my other apps and look for
"As Control" and "As Object"....
--
PeteCresswell
Sep 27 '06 #4
Per Tom van Stiphout:
>Got it. The key "TrancheRec57" is duplicated, and line 1406 fails
because of it.
Oops!.... In spite of what I said before about thinking the keys were not
dupe'd... when I started testing the new version of the mini-app by stepping
through the code I found out you are 100% correct.

I'd call that "Case Closed".... and try not to think about the unexplained shift
in control from the error trap to the calling routine.

Thanks again.
--
PeteCresswell
Sep 27 '06 #5
Per (PeteCresswell):
>I'd call that "Case Closed"....
Just for the record, the problem turned out to be:

I was loading the tree from a query pointed at a work table.

The work table, when created, was already ordered by DealName, Tranche.

The query against the work table was just SELECT * ORDER BY...

In the real app, ORDER BY was created dynamically depending on the user's
specification of primary, secondary, tertiary sort keys.

Problem was that when ORDER BY was, for instance, DealName, the records did not
always come back the way a dummy like me would have expected (i.e.
DealName/Tranche).

The fix was to amend ORDER BY to "DealName, TrancheNumber"...

When I get some time, I'm going to go back and try some testing to
verify/disprove my suspicion that in the problem case each invocation of the
query can return records in slightly different orders - albeit still ordered by
the specified key. That would explain why the problem didn't always happen on
the same input record.

Thanks again...

--
PeteCresswell
Sep 27 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matthew Alton | last post by:
The appended program freaks python 2.2 & 2.3 completely out. To reproduce the wierdness: i) copy the source to a file called consarn.py ii) $ python consarn.py; iii) the program is now doing a...
13
by: Tek Boy | last post by:
I've been experiencing some (reproducable) wierdness when I try to generate some very basic HTML using ASP. Check out the following (basic) ASP code: ===========================================...
0
by: amber | last post by:
Hello, I'm having some wierdness with a report I've created in VB.NET (with Crysal Reports). The report is called repCPDocSubmissionSummary.vb I created it a while ago, and have been using it...
42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
5
by: Eduardo Olivarez | last post by:
The following code does not work correctly on my machine. Either one of the scanf()'s alone work perfectly. However, when they are combined, the second scanf() call just reads what the first one...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
14
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
9
by: Bobby Edward | last post by:
Are there any add-ons to Visual Studio 2008 that will help me troubleshoot CSS wierdness? Like showing the padding/margin with difference colors, etc...? I'm trying to figure out some wierd...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.