V
Volker Neurath
Hello,
today I had a problem with my small database that is driving me nut, because
I don't see any logical reason for this behaviour:
I have a treeview in the footer of my form. It's task is to show the
dependencies between the quotations (the DB stores information about
quotations) i.e. which was the first q. of a project, how many quotations
are there for this project and so on.
When I do a doubleclick on one of the nodes the data of the corresponding
quotation should be shown.
Ok, all this I solved yesterday, I tested and it worked - or it seemed to
work.
Today morning:
I started my main form, pressed a button and => an error occurred.
I wondrered, pressed another button =>error.
A few minutes later I was sure: nothing worked.
Test in my development-database ==> it allworks fine.
Another three quarters of an hour later I kew why and solved it:
The productive database had lost one required reference - for what reason
ever...
Ok, at least, all main functions work but:
the doubleclick on the treeview nodes behave strange - on the first
recordset it works fine and opens the related recordset. but when I
navigate to the forth or fith set, and try again, access insists in not
finding a property of a control (but why does it find it, when i try the
first recordset?).
This ist the code, thrown on Node-Doubleclick:
--------
Private Sub tvwHistoryTree_DblClick()
Dim lst As String
Dim sql As String
Dim quot As Long
lst = "lngQuotationNr"
quot = objTreeview.SelectedItem
sql = BuildCriteria(lst, dbLong, quot)
Me.Filter = sql
Me.FilterOn = True
Me!cmdHistoryFilterEnde.Enabled = True
objTreeview.Nodes.Clear
Call FillHistoryTree(Me!txtMasterQuotation, 0) <-- this line causes the
error!
End Sub
---------
some further tests have shown that Access cannot find the .value property of
txtMasterQuotation, but why?
And why can't Access find IT, when I run the code on a record set in the
tables "middle", but can, when the code is run on the very first recordset?
Last but not least, here's the code of FillHistoryTree:
-----------
Private Sub FillHistoryTree(lngMaster As Long, lngVorgaenger As Long)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim objNode As MSComctlLib.node
Set db = CurrentDb
If lngMaster = 0 Then Exit Sub
If lngVorgaenger = 0 Then
Set rst = db.OpenRecordset("SELECT lngQuotationNr,
lngMasterQuot, lngVorgNum " _
& "FROM tblQuotMaster " _
& "WHERE lngMasterQuot = " & Me!txtMasterQuotation & "
AND lngVorgNum = 0;")
Else
Set rst = db.OpenRecordset("SELECT lngQuotationNr,
lngMasterQuot, lngVorgNum " _
& "FROM tblQuotMaster " _
& "WHERE lngMasterQuot = " & Me!txtMasterQuotation _
& " AND lngVorgNum = " & lngVorgaenger & ";")
End If
Do While Not rst.EOF
If lngVorgaenger = 0 Then
Set objNode = objTreeview.Nodes.Add(, , "Q" &
rst!lngQuotationNr, rst!lngQuotationNr)
Else
Set objNode = objTreeview.Nodes.Add("Q" & lngVorgaenger,
tvwChild, "Q" & rst!lngQuotationNr, rst!lngQuotationNr)
End If
Call FillHistoryTree(lngMaster, rst!lngQuotationNr)
rst.MoveNext
Loop
Set objNode = Nothing
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
Anybody out here, who can give me a hint?
And: isit possible, that the reason for this mystery is the fact, that I do
not run a local Access installation but work on a Citrix Remote Server
which is, in fact, a server*farm* and we cannot influence or guess which
server we connect with?
Volker
today I had a problem with my small database that is driving me nut, because
I don't see any logical reason for this behaviour:
I have a treeview in the footer of my form. It's task is to show the
dependencies between the quotations (the DB stores information about
quotations) i.e. which was the first q. of a project, how many quotations
are there for this project and so on.
When I do a doubleclick on one of the nodes the data of the corresponding
quotation should be shown.
Ok, all this I solved yesterday, I tested and it worked - or it seemed to
work.
Today morning:
I started my main form, pressed a button and => an error occurred.
I wondrered, pressed another button =>error.
A few minutes later I was sure: nothing worked.
Test in my development-database ==> it allworks fine.
Another three quarters of an hour later I kew why and solved it:
The productive database had lost one required reference - for what reason
ever...
Ok, at least, all main functions work but:
the doubleclick on the treeview nodes behave strange - on the first
recordset it works fine and opens the related recordset. but when I
navigate to the forth or fith set, and try again, access insists in not
finding a property of a control (but why does it find it, when i try the
first recordset?).
This ist the code, thrown on Node-Doubleclick:
--------
Private Sub tvwHistoryTree_DblClick()
Dim lst As String
Dim sql As String
Dim quot As Long
lst = "lngQuotationNr"
quot = objTreeview.SelectedItem
sql = BuildCriteria(lst, dbLong, quot)
Me.Filter = sql
Me.FilterOn = True
Me!cmdHistoryFilterEnde.Enabled = True
objTreeview.Nodes.Clear
Call FillHistoryTree(Me!txtMasterQuotation, 0) <-- this line causes the
error!
End Sub
---------
some further tests have shown that Access cannot find the .value property of
txtMasterQuotation, but why?
And why can't Access find IT, when I run the code on a record set in the
tables "middle", but can, when the code is run on the very first recordset?
Last but not least, here's the code of FillHistoryTree:
-----------
Private Sub FillHistoryTree(lngMaster As Long, lngVorgaenger As Long)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim objNode As MSComctlLib.node
Set db = CurrentDb
If lngMaster = 0 Then Exit Sub
If lngVorgaenger = 0 Then
Set rst = db.OpenRecordset("SELECT lngQuotationNr,
lngMasterQuot, lngVorgNum " _
& "FROM tblQuotMaster " _
& "WHERE lngMasterQuot = " & Me!txtMasterQuotation & "
AND lngVorgNum = 0;")
Else
Set rst = db.OpenRecordset("SELECT lngQuotationNr,
lngMasterQuot, lngVorgNum " _
& "FROM tblQuotMaster " _
& "WHERE lngMasterQuot = " & Me!txtMasterQuotation _
& " AND lngVorgNum = " & lngVorgaenger & ";")
End If
Do While Not rst.EOF
If lngVorgaenger = 0 Then
Set objNode = objTreeview.Nodes.Add(, , "Q" &
rst!lngQuotationNr, rst!lngQuotationNr)
Else
Set objNode = objTreeview.Nodes.Add("Q" & lngVorgaenger,
tvwChild, "Q" & rst!lngQuotationNr, rst!lngQuotationNr)
End If
Call FillHistoryTree(lngMaster, rst!lngQuotationNr)
rst.MoveNext
Loop
Set objNode = Nothing
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
Anybody out here, who can give me a hint?
And: isit possible, that the reason for this mystery is the fact, that I do
not run a local Access installation but work on a Citrix Remote Server
which is, in fact, a server*farm* and we cannot influence or guess which
server we connect with?
Volker