Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TreeView (Access 97)

    I have mixed success in Filling an xTree object in a form with data from a query....

    I am able to Build the tree using the query as the recordset as in this
    first bit of code to build the tree ...
    - - - - - - - - - - - - -
    Private Sub StartTree()
    On Error GoTo ErrStartTree
    Dim DB As DATABASE, rst As Recordset, nodCurrent As Node
    Dim objTree As TreeView, strText As String, nodRoot As Node
    Dim bk As String
    Set DB = CurrentDb
    Set rst = DB.OpenRecordset("TreeQuery", dbOpenDynaset, dbReadOnly)
    - - - - - - - - -

    this only works if the query "QueryTree" has no criteria arguments or a " fixed quoted value".

    It will not work if the query contains a criteria argument such as a value of a combobox . ..
    [Forms]![TreeView_Form]![ComboBox_Value]

    I get an error "Too few parameters. Expected 1"


    Any suggestions? Thks
    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TreeView (Access 97)

    In similar situations, I have replaced the "form-based" criteria with a function (e.g. =getFormData() ). Then within the function, read the value from the form.
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •