Search results

  1. MajP

    Solved Transferring data from unbound MS Access Form to another form

    This is why you should not use bang but dot notation wherever possible and do not EVER EVER put spaces in any name of anything. Are you sure you have a control of that name? Me![sfrmPosLineDetails Subform] but this would have told you if using dot and a normal name. me.sfrmProslineDetails Why...
  2. MajP

    Solved Treeview address

    These are the values that I normally save for most Trees. TreeviewSort - If you read the nodes from the top to bottom that is the order they appear regardless of level NodeLevel - How far it is indented in the branch. Top level is 1 LevelSort - For a give group of child nodes this is the order...
  3. MajP

    Programmatically construct a constant's name and return its value

    I think I would update the class so you have run time "setable" constants and design time read only. 1. Provides intellisense for coding 2. Can set a "constant" only once and throws error if you try a second time. 3. throws and error if "constant" not set and try to access Private...
  4. MajP

    Programmatically construct a constant's name and return its value

    What is the purpose that you are trying to achieve? The only thing I can guess is that you want to set the value once like a constant and not allow your code to reassign. If that is the case could you make a single class with all your constants and do something like. Private pCon1 As Variant...
  5. MajP

    Solved Treeview address

    I am not following your numbering scheme. Is it the outline level like E2E demo 1 --1.1 --1.2 --1.3 -----1.3.1 -----1.3.2 2 3
  6. MajP

    Speed Up Query

    In my government experience it was always the opposite. There never seemed to be time or money to do it right the first time, but there always seemed to be some miracle where we found the time and money to do it a second time.
  7. 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...
  8. 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...
  9. 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.
  10. 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)
  11. 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 =...
  12. 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"
  13. 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"...
  14. 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...
  15. 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
  16. 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?
  17. 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...
  18. 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...
  19. 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 &...
  20. 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...
Back
Top Bottom