Search results

  1. MajP

    Speed Up Query

    @Mister-B, if you want help on restructuring this and moving the data this group can help. You may think that is too much work, but you will quickly find out a little work now will save lots of time later. For example this query would be a one liner with a properly designed db. Moving all the...
  2. MajP

    Solved Treeview nodes error

    From what I am seeing it appears to load all the nodes with the proper tag, but somehow it is lost later or a specific node does not have a tag. Without seeing your application, I do not think I can help. There is no place that the code clears the tag so that is unlikely. There is a mistake in...
  3. MajP

    SQL Code in Access Report

    My point was more about the ease of building, ease of error checking, and ease of use. Once you build your query you will immediately see the results and if they are not quite right you can easily modify the query. Then your call to the query is extremely simple using a dlookup and a given year.
  4. MajP

    SQL Code in Access Report

    That is hard to debug with all the formatting and logic. I would make a single query qryDonorsPerYear do an aggregate query where constituency = Alumni Then your formula is dlookup("NumberDonors","qryDonorsPerYear","DonorYear = " & year(date) - 1)
  5. MajP

    Solved Treeview nodes error

    When the class loads the tree and adds the node it reads the query and puts the Identifier into the tag property Do Until Me.Recordset.NoMatch currentID = Me.Recordset.Fields(ID_Field) currentText = Me.Recordset.Fields(Node_Text_Field) currentIdentifier =...
  6. MajP

    Solved Treeview nodes error

    Can you post an image of your query. I am guessing the query is not formed correctly and therefore the "Identifier" is not in the tag property. Notice that the identifier has to be the prefix to the ID which is "Identifier & RealPK"
  7. MajP

    Question on Comboboxes

    In VBA there is null propagation, that was the recommendations for a "+" Null + String = null Null & string = string Public Sub Test() Dim CompanyName As Variant Dim lastName As Variant Dim firstName As Variant firstName = "Eddie" lastName = "Money" CompanyName = "Acme"...
  8. MajP

    Solved Treeview nodes error

    Trouble shoot that with a debug.print I only ever use numeric PKs. If you build your node query correctly, you concatenate the identifier and the real PK together to build the index. Then you store the identifier in the Tag property. Example ID in node query becomes Location_1 the Node index...
  9. MajP

    Question on Comboboxes

    There are probably a few ways to do this. You could union the values and in one combobox see both people names and company names if people names do not exist. You could have a radio button over the combobox (Pick Person Name, Pick Company Name) and change the rowsource of the combobox
  10. MajP

    Question on Comboboxes

    Are the chosen values saved in the same field in the table? What is the control source of your current combobox and if you showed the company name where would that get saved?
  11. MajP

    Solved Treeview nodes error

    My getNodeLevel function was dumb too. Should be Public Function GetNodeLevel(myNode As Node) As Integer 'saving the PK as the key and the level in the value Dim intCount As Integer If Not myNode Is Nothing Then intCount = 1 Do Until myNode.Parent Is Nothing Set...
  12. MajP

    Solved Treeview nodes error

    The original code is so bad and only works in spite of itself. Probably doing some drinking when I wrote that. The root is the very first node so assume you are on a branch not on the first node branch. Such as Mozarell di.... And we know that the root property is Alfki and we really want...
  13. MajP

    Solved Treeview nodes error

    This seems to be more correct. Public Function FindRoot(ByVal nodX As Node, TVW As TreeView) As Node On Error GoTo ErrHandler While Not nodX.Parent Is Nothing Set nodX = nodX.Parent Wend Set FindRoot = nodX exit function ErrHandler: MsgBox Err.Number &...
  14. MajP

    Solved Treeview nodes error

    It is exactly as I expected. The root property is worthless. It returns node 0 every time. I still think my code is a little weird and you should simply be checking if the nodes parent is nothing. The root property returns the top level Node not the root node for the given branch. So it is...
  15. MajP

    Solved Treeview nodes error

    Looking at that, I am not sure why I wrote it like that. I am thinking the Root property does not give you exactly what you expect. As @cheekybuddha points out you would think it would return the root node for that branch and no loop needed. I can only guess it does not. I think in fact it...
  16. MajP

    A Function that returns a Recordset

    IMO that is unusable. Because it does not show which nodes are expandable there is no plus signs. You have to guess if you can expand it or not. Something this simple it may suffice but in a tree of any size with uneven branch depth it would not. The user is not going to want to click on...
  17. MajP

    A Function that returns a Recordset

    If I am using a domain aggregate function I am probably using it more than once. Even if I am uncertain of its reuse I tend to go ahead and put a wrapper around all domain aggregate functions. I find it to be the opposite. You end up wasting time if you do not wrap it. 1. If I think I will...
  18. MajP

    A Function that returns a Recordset

    But like @Pat Hartman suggests, most of my DBs have tons of Domain wrappers. Sometimes hundreds. Very simple and do one thing. You pass in an ID and get back a value. Public Function GetPathLength(pathID As Variant) As Long If Not IsNull(pathID) Then GetPathLength = Nz(DLookup("length"...
  19. MajP

    A Function that returns a Recordset

    The question is not very clear, for what you want to do. But sounds like you want to get some values from a recordset and then disconnect the recordset. That will not do it because you create another pointer to the instance in the calling code. Are you returning one record with lots of fields...
  20. MajP

    ItemGenie location address

    There is an afterLabelEdit and beforelabeledit event procedure of an active X treeview. This event occurs when you edit the node text. The procedure gets the new node text passed into it as an argument. You also will know the active node since that is a property of a treeview. Private Sub...
Back
Top Bottom