I'm really new at VB.
But I'm learning. I'm also learning to work around access too.
What I'm trying to do is have a Form with a TreeViewCtl that acts as a menu for other forms.
I'd like to have the TreeViewCtl open those forms in a subform so there is always just one form open at all times.
This way my "clients" don't get lost in the forms. Believe me, they get lost easily...
I already posted a question like this here:
http://www.access-programmers.co.uk/forums/showthread.php?t=80756
But I'm not sure if this is a VB question (TreeViewCtl) or a Forums question...
A sample of what I'm trying to do is available at the link.
My TreeViewCtl works fine, but the forms open in seperate forms.
Sorry for the dbl-post.
Does anyone have any ideas?
I've been searching google for 2 weeks without any answers.
I have an unbound form on that form I want to put three sub forms one on a products table the other on a course start dates table and the link table that joins the other two together. all three are related to each other with Pk/FK links.
When I try to link them it says you cannot link items on an unbound form.
I use Access 2010 on Windows 7 64b to create a form with a Treeview control. However, this control is missing from the list of controls activix. How can I add?
I downloaded a sample treeview application I have modified most of its to suit my need, except one thing. I want link parent/child node the main form to the main form through a subform on the CategoryID.
The following is the original code where when a child not is clicked only pops up a "linked" msgbox. I need to modify the part of the code on the Select Case "C" in red:
Code: '---------------------------- Sub DisplayForm(i As Integer) '---------------------------- ' for this Treeview I do not want a double-click on a parent node ' to open the applicable Category form, but pressing the shift key ' should open the marriage form applicable to the parent node. Shift ' or double-click on a child node should open the applicable ' offence form.
Dim strKey As String Dim strTag As String Dim strFilter As String
Still fighting to understand a darn thing about treeviews. What I was hoping to do was create a kind of knowledge base that I could integrate into a larger database I'm using. I wanted for each entry to have a category, short description and then longer details. Then for the treeview to display each item grouped by category. So in the treeview, you'd click on Category 1 and it would display every knoweldge base item that is in category 1. Click on any of those nodes and have the subform change to display that knowledge base item.
I have NO idea how to design the treeview to do this. But have laid out the database to do just about everything else.
I just discovered TreeView Controls after browsing through this site today...in a word, awesome!
I've done alot of searching, and it seems that most of the discussion on TreeView is at a data level.
What I am wondering is if a TreeView can be used as a database navigational pane...ie switchboard, where the nodes are comprised of individual forms and/or reports, that when clicked, opens the associated form/report?
Does anybody have a sample db where this is being done or can somebody give me some tips on doing this?
I have a sample treeview.mdb in 2000, and I can freely create the parent and child nodes. That is the extent of my knowledge. I don't know how to make the nodes "actionable".
I've been trying to use TreeView control to display my computer's directories and folders just like Windows Explorer does.
Thanks to Popeye for reposting all the Treeview samples (samples posted before the site was hacked). Most or all of these samples, TreeView is used to display data out of tables. Mr. Ghuson posted a great example for browsing directory but it pops up a separate windows for browsing.
Now I'd like to somehow combine the two into one; browsing thru directories and folders using TreeView Control. Yes that I can browse and save all paths and directories to different tables and add them to the TreeView control but I'm trying to stay away from saving data to tables first.
Can this be accomplished? Can Windows Explorer be somehow embeded on an Access form or called? Any ideas, experts out there?
I have a treeview control which is based on a table.
For some reason it won't fill properly, it doesn't add the nodes under the correct parent. If someone could look at the attached file and help me out I'd appreciate it.
This is the first time I've tried to work with a treeview control and it's very challenging. I've developed the branch building code in the form's module to a point where I'm confused on how to proceed. I've attached the database and a "readme" file to this posting. I hope someone can help me.
I need a help/pointer converting this cascading list boxes into treeview control. Please help. All the data I need to construct a treeview is already at category_info table, but unable to show it attrib_cde (parent), Stage (child of parent), and ID (child of Stage). Any help or a quick example is highly appreciated.
I'm venturing into the abyss of treeviews and have read many threads on this subject. I have two questions to ask regarding the attached sample db, if anyone can help me please.
1) How can I adapt the existing code and create subnodes (or sub child nodes). For example, how can I create a sub-node of OPEN FORM2? 2) What is the syntax for an ONCLICK event, i.e. by clicking on OPEN FORM2 I want it to open FORM2?
I'm trying to create a form that is reading filenames from a certain folder on my computer. The filenames have some prefixes - 'tu' , 'tc' , 'bf' , 'tf' and 'act'. each filename that is read is being displayed (without it's prefix) in a list and has another attribute (type) that the prefix is inserted into it.
Does someone know how to start this kind of application ?
I have an application that uses a treeview to load a product hierarchy (n-number of levels deep) for an electroinic system based on a querydef that provides the following data:
Parent | Child | ChildName
I am able to load the treeview control using recursive lookups without an issue. Difficulty arises when a Child assy points to more than one Parent (happens in about 20% of the Systems sampled so far). This is a legitimate condition. Example: CircuitCardA (Child) is used in more than one Box (Parent) in an electronic system (Recordset).
I have played with a couple strategies of concatenating the ParentName with the ChildName, but this breaks the referential integrity of the tree.
Can anyone suggest strategies to deal with legitimate non-unique keys in a Treeview?
Am looking to do a treeview type of search to hyperlink to client file/folders on my network. This way I can hide the main file source location in the network and files can just be accessible via Access program search.
So far I found this link [URL] and the 3rd bottom option seems to be the most promising but I cant seem to figure how to accomplish the hyperlinks.
If anyone wants to test this out to verify its a true bug it would be helpful:
Create a tab control. Place a treeview control (with checkboxes = Yes) on one of the pages. Populate the treeview. Check some boxes. Move to the next page of the tab control. Return to the page with the treeview. Viola! The checkboxes you checked previously are all unchecked. (Not just visually, but property-wise as well).
One step forward, two steps back.
Actually, the work around is to remove the treeview from the tab control and then change the Visible property of the treeview to False if on a different tab page, and True if on the page you want it to display on. But c'mon why can't it work the way you'd expect it to work!
I have managed to populate a treeview with some menu items I required and it looks great but I now need to get it to do something. How do I get a tree view value (selection) to act as a variable in routine. e.g. if my tree look like this.
Menu ¦ - Compaint management I I----My compaints
When I "double click" on My Complaints I want it to a open a specific form. One I know how to do one action I should be able to figure the rest out for myself.
Hi I am trying to create a treeview based on a table that I created. I am trying to create a treeview that fills the treeview recursively but for some reason I am only able to see the parent node and not the children
Here are the specs that I have so far
I have a table called "tblTreeview" I have tree fields "txtID" "txtNode" "txtRelationship" I also have a form called "frmTreeview" I named my treeview control "axtreeview"
here is the code that I copied off the link that I referenced at the beginning of this thread.
The only thing that is different is the name of the fields.
'--Beginning Code -- Private Sub Form_Load() Const strTableQueryName = "tblTreeview" Dim db As DAO.Database, rst As DAO.Recordset Set db = CurrentDb Set rst = db.OpenRecordset(strTableQueryName, dbOpenDynaset, dbReadOnly) AddBranch rst:=rst, strPointerField:="txtRelationship", strIDField:="txtID", strTextField:="txtNode" End Sub
'================= AddBranch Sub Procedure ====================== ' Recursive Procedure to add branches to TreeView Control 'Requires: ' ActiveX Control: TreeView Control ' Name: xTree 'Parameters: ' rst: Self-referencing Recordset containing the data ' strPointerField: Name of field pointing to parent's primary key ' strIDField: Name of parent's primary key field ' strTextField: Name of field containing text to be displayed '================================================= ============ Sub AddBranch(rst As Recordset, strPointerField As String, _ strIDField As String, strTextField As String, _ Optional varReportToID As Variant) On Error GoTo errAddBranch Dim nodCurrent As Node, objTree As TreeView Dim strCriteria As String, strText As String, strKey As String Dim nodParent As Node, bk As String Set objTree = Me!axTreeView.Object If IsMissing(varReportToID) Then ' Root Branch. strCriteria = strPointerField & " Is Null" Else ' Search for records pointing to parent. strCriteria = BuildCriteria(strPointerField, _ rst.Fields(strPointerField).Type, "=" & varReportToID) Set nodParent = objTree.Nodes("a" & varReportToID) End If
' Find the first emp to report to the boss node. rst.FindFirst strCriteria Do Until rst.NoMatch ' Create a string with LastName. strText = rst(strTextField) strKey = "a" & rst(strIDField) If Not IsMissing(varReportToID) Then 'add new node to the parent Set nodCurrent = objTree.Nodes.Add(nodParent, tvwChild, strKey, strText) Else ' Add new node to the root. Set nodCurrent = objTree.Nodes.Add(, , strKey, strText) End If ' Save your place in the recordset so we can pass by ref for speed. bk = rst.Bookmark ' Add employees who report to this node. AddBranch rst, strPointerField, strIDField, strTextField, rst(strIDField) rst.Bookmark = bk ' Return to last place and continue search. rst.FindNext strCriteria ' Find next employee. Loop
exitAddBranch: Exit Sub
'--------------------------Error Trapping -------------------------- errAddBranch: MsgBox "Can't add child: " & Err.Description, vbCritical, "AddBranch Error:" Resume exitAddBranch End Sub
Hi all, I have a form wich contains 2 subforms, these subforms are runned by a query wich selects data between a range of dates, the problem is when i open the form it will ask me the range of dates twice, once for one subform and then again for the other, as the range of dates are the same for both subforms is there a way to open the form typing only once the range of dates? Thanks Marco
I am using Windows 8.1 64 bit system. Into attached access file (OfferStudy.accdb) ,trying to load an activeX TreeView control by defining into a form module. First, I created an empty form and activeX Treeview control.When I define tv variable As TreeView as created in application, it is changing as Dim tv As treeView instead of TreeView. After my code is completed,an error message ("user-defined type not defined") is returning as shown in attached (DebugError.png)file.
I suppose that there is some conflict on creating activeX control on my Access 2013 application.
i have a stock control db. when new stock is ordered it updates 'units on orders' field, then when goods are recieved the subform field is updated and this automatically updates the 'units on hand field'.
i then have another subform for stock going in and out, i would like to be able to have the units on hand field as above (which is the main form) automatically updated like is when using the the goods recieved sub form??
not sure if i explained it properly but i can send the structure if that helps?
My main form has four command buttons that when clicked will make visible one of four subforms.
I can switch freely about the subforms by clicking on each of the buttons. However, when I place the cursor in a subform(and thus give it Focus), and then attempt to select another button to open another subform, I get the dreaded "can't hide a control that has the focus" error message.
What type of code should I use and where exactly should I be putting it?
I've tried setting focus to another subform in the OnClick event of my buttons, but that doesn't seem to be working.
I have a problem with main form and two subforms in it. Both subforms are in "continuos" mode, and each of them has field in footer, where it calculates total sum for all field that are in it.
Then there is main sum below both subforms (all this is in detail section of form) and it calculates total for both sums of each subform.
Whenever i fill values in first subform and in second subform, i have results everywhere, but if i fill values in first subform but leave second subform empty, the "main sum" below both subforms is empty also....
The control source for main sum field is "=Forms!frmMainForm!frmSubform1!Text1 + Forms!frmMainForm!frmSubform2!Text2" where Text1 is "total sum" in first subform and Text2 is "total sum" in second subform...
I set default value = 0 for all fields in both subforms, but it won't help....still shows empty fields in that subform, which isn't filled....Actually when i open form for the first time, it shows "0" values in all empty fields and then immediately clears them and shows empty fields...
I need a form with 2 subforms. the main form is for an indidual. the first subform is a list of characteristics. the second subform is sort of a calendar function, produced for date scheduled, results, next meeting date.
I have tried the form wizard, but it produces a jumble of the mixed fields. Can I create a subform or 2 before I create the main form, and then link them somehow?
I want to create a form with two subforms. I create a form with one subform without problems but i would like to know how i can link the two subforms, so when i select a row in first subform display records in second subform.
is it possible to have 3 subforms in a form?if so how would i go about this i have created the form and the 3 subforms however it only allows me to link one into the form.