Search results

  1. 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
  2. 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?
  3. 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...
  4. 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...
  5. 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 &...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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"...
  11. 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...
  12. 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...
  13. MajP

    ItemGenie location address

    Here is the fix Public Sub RecurseIGTree(Optional ByVal ParentID As Variant = Null, Optional RS As dao.Recordset = Nothing, Optional ByVal Path As String = "") 'This assigns the levels and tree sort 'if the top level parent ID is null do not pass in anything Dim strCriteria As String...
  14. MajP

    ItemGenie location address

    Let me redo that. I can see that is not correct for the dining room shelves.
  15. MajP

    ItemGenie location address

    There are two ways to do this. You can leverage the tree once it is loaded or you can do a recursive loop of the data. The E2E uses the tree, but it is kind of clunky. I used an intermediate dictionary to hold the values so I did not have to do it recursively. Here is a more generic method...
  16. MajP

    Getting an error 3825, complaining about multi-valued fields, but none are involved.

    Since you do not specify any columns are your completely sure that all the fields line up and same data type?
  17. MajP

    Getting an error 3825, complaining about multi-valued fields, but none are involved.

    Any chance there is an attachment field? Which is a MV field but many people do not call it one so might not have been recognized as one.
  18. MajP

    ItemGenie location address

    No, in fact I demo this concept in several places In this image the "paragraph" outline numbering is done this way by a recursive call. As you move the node it recreates the outline number (location) TopLevel.Child.grandchild.greatgranchild........levelOrder...
  19. MajP

    Getting an error 3825, complaining about multi-valued fields, but none are involved.

    Should that be of the form INSERT INTO external_table IN 'C:\Path\To\ExternalDB.accdb ... not INSERT INTO '[C:\Path\To\ExternalDB.accdb].[tableName]'... https://support.microsoft.com/en-us/office/insert-into-statement-e12fd58b-33b1-479c-8221-e9f245ab8d24
  20. MajP

    Variable assignment not working.

    What you describe seems strange, but out of curiosity does this give the same error? in your module where you declare you global what if you did something like Public glblRRE as RegExp Public Function getRRE() as RegExp if glblRRE is nothing then set glblRRE = new RegExp set getRRE =...
Back
Top Bottom