Treeview in MS Access: Part 1 - The basics, loading information into the treeview

  Рет қаралды 87,957

TheSmileyCoder

TheSmileyCoder

Күн бұрын

This is part 1 of a video series on how to use Treeviews in MS Access 2003-2010. (Sample code available at
www.TheSmileyCo...
Part 1 describes how to load information from a recordset into the treeview, and make small modifications to the layout.
A few people have noticed issues with regards to getting the reference set to the common control library. Usually this is set automatic when you add the active X control, however due to issues with a faulty Microsoft patch, you may need to follow the advice given in
support.microso...
Your results should more closely match my video.

Пікірлер: 73
@Myltion
@Myltion 2 жыл бұрын
Just letting you know that even in 2022 this video is still helping people! This tutorial is excellently done and helped me a lot regarding a project. Thank you! :)
@TheSmileyCoder
@TheSmileyCoder 2 жыл бұрын
Thanks, I appreciate it!
@UncleLoren
@UncleLoren 3 жыл бұрын
In many years of Access development, I had never used TreeViews. The instructions in this video are excellent, everything worked the first time for me, and I'm going to have to watch the rest of the series. It's hardly unusual for data to have a hierarchical representation. I'm excited about using these controls to help the user navigate recordsets and/or change the data displayed on forms. If anyone has trouble with the formatting aesthetics, backcolor, etc., -- and your problem isn't addressed in the other videos -- try playing around with the property settings or modifying them in vba. Lots of useful info out on the various coding forums. Thank you so much for sharing your knowledge, TheSmileyCoder. (Subscribed!)
@TheSmileyCoder
@TheSmileyCoder 3 жыл бұрын
Hi. Glad to hear you liked it, and the video is still relevant :)
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Thank you Crystal. Glad you liked it. It means a lot coming from someone with your experience in creating online video tutorials.
@zsugo1
@zsugo1 4 жыл бұрын
Thank You, it was very helpful in my project (in fact before I can't imagine how to manage multiple levels in Access). Great job !
@TheSmileyCoder
@TheSmileyCoder 4 жыл бұрын
Glad you liked it!
@SimonPowell1000
@SimonPowell1000 7 жыл бұрын
That video series was awesome, I've been working with hierarchies in a very cumbersome, restrictive manner until I saw this! Appreciate the effort you put in :-)
@diemswo
@diemswo 7 жыл бұрын
I'd like to thank you TheSmileyCoder very much for this nice video, which guided me on creating a TreeView object in my database! My only suggestion would be to include in its begging the instructions you gave in the comments section of your homepage in 2013 regarding the reference to the “Microsoft Windows Common Controls 6.0 (SP6)”. With warm regards from Brazil!
@TheSmileyCoder
@TheSmileyCoder 7 жыл бұрын
Thank you for those kind words. At the time of making the video in Access 2010, the reference was added automatically. Sadly, changing the video is rather difficult, which is why I haven't "fixed" the issue you mention.
@tchew
@tchew 11 жыл бұрын
Thanks for this Anders... looking forward to going through all the videos in this series. At the 13 minute mark you configure some of the TreeCtrl Properties... for me, all the drop-down options are empty for me - you wouldn't know what's causing this?
@amysarkar
@amysarkar 12 жыл бұрын
Perfect! Just what I needed just when I needed it. Thank you so much for putting this out there.
@헌일김-w9w
@헌일김-w9w 2 жыл бұрын
I am using a treeview in a form but I can't set the accurate width and height in the design view. When I have set the width and height I want, I get smaller results than I have set. I have no idea how to fix this problem. Please let me know if you know how to fix this problem.
@dollysjoseph
@dollysjoseph 11 жыл бұрын
This was EXTREMELY informative!! Thank you for doing this!!
@adrianconnolly8568
@adrianconnolly8568 Жыл бұрын
Hi Is there any means to use MS Access as a document manager to view the contents of a SharePoint folder, for file like word and excel file within a folder and open them for mail merge etc. And display those file’s in a list box using treeview
@macy1234ish
@macy1234ish 11 жыл бұрын
I've been looking for a demo on treeview for some time. Thank you
@GKeeperWillie
@GKeeperWillie 11 жыл бұрын
I had the same problem with finding the correct reference. For other users here is what needs to be done: in VBA go to "Tools", "References", click "Browse" and in the C:\Windows\System32 folder select the MSCOMCTL.OCX file.
@LearnAccessByCrystal
@LearnAccessByCrystal 11 жыл бұрын
excellent introduction to using the TreeView control in Microsoft Access, thanks Anders ~ Crystal ~ have an awesome day ~
@joshuaseaton3205
@joshuaseaton3205 2 жыл бұрын
Great video! Very helpful.
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
@Thomas Andersen You are quite correct. I suppose it could be a version issue. When I add the treeview control in Ac2010 the reference is automatically added for me, but perhaps it is not so in earlier versions of Access. Which version are you using?
@BaubetriebBoettcher
@BaubetriebBoettcher 3 ай бұрын
Thank you very much, it's great 😀
@maria_venckovskaya
@maria_venckovskaya 2 жыл бұрын
You're the best! Thank you :) It's was helpful for me.
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
No matter leave, thank you, yet there has been no expert who can answer my question, maybe I can do it despite my limited experience, Greetings
@AbdallaAwad
@AbdallaAwad 4 ай бұрын
This is super professional , thanks how can i get the sample code, website is unreachable now
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Did you check out part 2 of the tutorial on how to navigate the treeview by use of the node click event?
@rickhdee
@rickhdee 9 жыл бұрын
Thank you for an informative and very well done tutorial.
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Hi Matt I haven't heard of that happening before. I would start by checking there is a reference to the treeview controls library. Open your VBE and look at the reference for "Microsoft Windows Common Controls 6.0 (SP6)". On some systems the reference must be set manually. From the reference window browse to your windows directory and select the MSComCtl.OCX file. If that doesn't work, I need some more info on your Access and windows version (and 32 / 64 bit) to be of more help. TheSmileyCoder
@GKeeperWillie
@GKeeperWillie 11 жыл бұрын
Thanks. And by the way thanks a lot for making and uploading the video. It was just what I needed to get my treeview form up and running :-)
@beluga59
@beluga59 9 ай бұрын
just great, thank you
@oscarb4240
@oscarb4240 4 жыл бұрын
Hi. I followed your video to create a treeview in access 2019. when I run the code as per the 12:12 mark access locks up. I have tracked it down to it being stuck in an infinite loop becuase the bookmarks are not working. When I test to see if the recordset is bookmarkable Access state that it is not. I have searched but cannot find a reason as to why this is. Could you help? Thank you in advance.
@js-cx8wk
@js-cx8wk 3 жыл бұрын
thank you so much!!!
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Hi Cesar. Sorry but I have no idea what your are talking about. I would suggest you post your question at a access site like UtterAccess which is more suited for this kind of discussion, as youtube posts are somewhat limited in both length and formatting.
@MuhammadSibtainArain
@MuhammadSibtainArain 11 жыл бұрын
Dear ThesmileyCoder I have done all as you explained in your this session, but unfortunately i am unable to have the child node under the parent node instead all the parent and child nodes in a single column shapp, furthermore, the parent node which i added first is coming in the last and all other nodes are adding in the reverse order, furthermore no plus minus sign is being appeared. Can you put some extra light on it Regards
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Don't forget to watch the rest of the tutorials. Just released part 6 on how to create new nodes/records from the treeview.
@abdulkaderalmograbi3428
@abdulkaderalmograbi3428 Ай бұрын
Thank You, it was very helpful project can you shear the all code in video
@LII0099
@LII0099 10 жыл бұрын
Génial. Exactement ce que je cherchais !
@facilitymanagement1895
@facilitymanagement1895 6 жыл бұрын
Im really thanking you from the heart for demonstrating this code of treeview access database. I would like to draw your kind attention demo another access treeview code for opening access form accordingly on the node we double click and the form name should be called from the table as well. Anxiously waiting for your reply.
@TheSmileyCoder
@TheSmileyCoder 6 жыл бұрын
I would recommend you look at part 2 of the series where I demonstrate "Navigation by treeview".
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
You can find it at my blog (I added the link to the video description).
@IoDavide1
@IoDavide1 10 жыл бұрын
I can't find all the events you can see at 3.25, I have 5 events. Where are all the others?
@joseuzcategui4198
@joseuzcategui4198 Жыл бұрын
Thank you
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
Can you help me with a code to apply in your example to open forms to give double-click each of the options
@Euroduplex
@Euroduplex 5 жыл бұрын
I'd like to set PK_Req and, thus, ID_Parent as Text(String, like G1.1.1.2). What change do I have to make for that on strFind = "ID_Parent=" & lngParentID? looks like I'm having continuous problem on that.
@TheSmileyCoder
@TheSmileyCoder 5 жыл бұрын
When using a string as a key, you must let access know that it is looking for a string. You do this by the use of single quotes, e.g. strFind="ID_parent'" & strParentID & "'"
@VitaliyYeliashevskyi
@VitaliyYeliashevskyi 4 жыл бұрын
Hi, I'm trying to build the treeview using this tutorial but I'm getting an error 28 Out of stack and access closes. Could you please help with the code? my data has approx 1800 lines and 4 levels deep
@TheSmileyCoder
@TheSmileyCoder 4 жыл бұрын
Hi Vitalii Two possible scenarios: Either you missed something in your code, and you have a infinite loop, thus adding nodes until you run out of memory. Alternatively, make sure your Office is fully updated. There was a bug maybe a year ago that caused issues with treeviews with more than a few hundred nodes (don't know the exact limit)
@sozonpv
@sozonpv 10 жыл бұрын
This is a great tool. Is it possible to apply a drag and drop feature? Can anyone provide any links to any working examples of this treeview in access database applications? Hopefully I'll have time to work on this.
@bsworldsolution6626
@bsworldsolution6626 4 жыл бұрын
How is this possible on vb.net
@AoE3Gamer
@AoE3Gamer 10 жыл бұрын
I'm getting a 'Type mismatch' error on Set tv = Forms("[formname]").[nameOfControl].Object Do you know what's wrong?
@TheSmileyCoder
@TheSmileyCoder 10 жыл бұрын
Hi Thomqa Where is your tv variable defined? You should have a line looking like Dim tv as mscomctlLib.Treeview (Inside procedure) or Public tv as mscomctlLib.Treeview (module level or global variable)
@AoE3Gamer
@AoE3Gamer 10 жыл бұрын
TheSmileyCoder It looks like this: Public Sub loadTreeview() Dim tv As MSComctlLib.Treeview Set tv = Forms("frm_RubriekenBeheer").TreeRubrieken.Object ....
@TheSmileyCoder
@TheSmileyCoder 10 жыл бұрын
Thomqa z. What access version are you using? Have you set the library reference? I found that when I made the video using 2010 the reference was set automatically when I inserted the treeview control, but others have reportet that they needed to set the reference manually. You might need to browse for it, it is usually located in the C:\Windows\SysWow64 and is named MSCOMCTL.OCX
@AoE3Gamer
@AoE3Gamer 10 жыл бұрын
TheSmileyCoder (Im using Access 2013 64-bit on windows 8) Yes, I already encountered that problem. It wouldn't recognize MSComctlLib.Treeview. At that moment I was searching for that file but I couldn't find it. So I downloaded it, then I made that reference. That solved the "MSComctlLib.Treeview" problem, but then the problem "type mismatch" occurred. ps. I placed the treeviewcontrol driver in my documents, from there I made the link. I tried to change it to system32 but it doesn't want to (I can copy it, but the reference can't be changed).
@TheSmileyCoder
@TheSmileyCoder 10 жыл бұрын
Thomqa z. Are you certain that you are using 64bit OFFICE? Note that the default is that 32bit office is installed, even when using a 64 bit Windows. The treeview control is not compiled nor written for 64 bit OFFICE, so it cannot work there. Myself, I use 64bit windows, but 32bit office and can use the treeview fine enough. On my blog I did create a post about having some troubles getting the treeview to work in Access 2013, but did get there eventually. You can take a look at www.TheSmileyCoder.com
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
Help me with a code to match the tutorial one the double click option with 2 forms aperturar TControl and NControl adjoining columns, the first identify varibles F = Form; C = Check, R = Report, S = Exit or DoCmd.Quit and A = back or return NControl column and put the names of the forms I want aperturar, thanks in advance
@mafgeology
@mafgeology 2 жыл бұрын
Great 👍
@نقلياتالغيدانى
@نقلياتالغيدانى 7 жыл бұрын
HI .. I have an acces database a mmaik form containes ather form want to cancel changes if save button isnot clicked..how can i do that..im asking if u can help me ..proff
@TheSmileyCoder
@TheSmileyCoder 7 жыл бұрын
This is not really related to the video or topic, so I suggest you ask your question at ExpertsExchange or Utteraccess.
@نقلياتالغيدانى
@نقلياتالغيدانى 7 жыл бұрын
thx..but i couldnt. reach u some where else..i have ask about it in the blog but no answer any way..thx alot
@GKeeperWillie
@GKeeperWillie 11 жыл бұрын
Actually I am using Access 2010 as well, running on Windows Vista. So I don't know why there is a difference.
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
I would ask you to please could you help me complimenting the code you need to double click to give me the node aperturar allow a form that indicated in the table, I have an example but I can not adapt to your example , I would beg if I can help , I need to pass an access cycle , TControl and NControl variables are 2 columns which I have adapted to the form, the first reference TControl if F is a form and the form name NControl you want to open . I can adapt these codes as your example that
@BernardSibanda
@BernardSibanda 11 жыл бұрын
where can i download this code?
@sherifKamalx1
@sherifKamalx1 7 жыл бұрын
in my access is not appear in menu activeX what I can do
@TheSmileyCoder
@TheSmileyCoder 7 жыл бұрын
Do a search for mscomctl.ocx on your machine to see if it is available. Then from the VBE reference window, you can browse for it, and manually select the file.
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
Odd. Using ac2010 on windows 7 myself, but I would have thought it would not be dependent on the windows version. Maybe something else I am just not seing. Anyway, best of luck with your project.
@ericbrenner690
@ericbrenner690 7 жыл бұрын
This seems to be WAY too complex just to populate a Treeview control. Why not just have a couple of parent and child items in a database and describe how to populate them?
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
Many experts, few know ..... or few who take time to answer a query for help
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
double click to open related form options
@TheSmileyCoder
@TheSmileyCoder 11 жыл бұрын
KZbin is good for sharing videos, its not good for a question/answer type of scenario. I suggest you visit UtterAccess and post a question. You will find hundreds of experts and several Access MVPs, and myself ready to help you understand and use Access. That forum is just better suited for posting technical questions, and supports attachments and links, which youtube does not.
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
Many experts, few know .....
@cesarbustos1504
@cesarbustos1504 11 жыл бұрын
hola
@roberto.melgar
@roberto.melgar Жыл бұрын
I want to load the folders of a directory I have this code, when loading it stops at a line CargarDirectorios nodoCarpeta.nodes, subcarpeta this is my code, can you help me please Private Sub Form_Load() ' Ruta de la carpeta principal Dim carpetaPrincipal As String carpetaPrincipal = "C:\Adm-Colegio" ' Verificar si la carpeta principal existe If Dir(carpetaPrincipal, vbDirectory) "" Then Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") Dim carpeta As Object Set carpeta = fso.GetFolder(carpetaPrincipal) ' Llamar al procedimiento recursivo para cargar el árbol de directorios CargarDirectorios TreeView1.nodes, carpeta Set fso = Nothing End If End Sub Private Sub CargarDirectorios(ByVal nodes As nodes, ByVal carpeta As Object) ' Recorrer las subcarpetas de la carpeta actual Dim subcarpeta As Object For Each subcarpeta In carpeta.SubFolders Dim nombreCarpeta As String nombreCarpeta = subcarpeta.Name ' Agregar la subcarpeta como un nodo hijo Dim nodoCarpeta As Node Set nodoCarpeta = nodes.Add(, tvwChild, , nombreCarpeta) ' Cargar recursivamente las subcarpetas de la subcarpeta actual CargarDirectorios nodoCarpeta.nodes, subcarpeta Next subcarpeta End Sub
Treeview in MS Access Part 2, Navigation by Treeview
12:02
TheSmileyCoder
Рет қаралды 26 М.
Как задать фильтр при помощи полей со списком Access
14:06
Уроки по Microsoft Access
Рет қаралды 67 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
小丑妹妹插队被妈妈教训!#小丑#路飞#家庭#搞笑
00:12
家庭搞笑日记
Рет қаралды 36 МЛН
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 11 МЛН
How to use ADO and VBA to Read from a Database
10:31
Excel Macro Mastery
Рет қаралды 43 М.
Building a Decision Tree Database in Microsoft Access. Part 1: Introduction
17:27
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 1 МЛН
Making a Custom Ribbon in Microsoft Access - Part 1
10:50
Access Jitsu
Рет қаралды 49 М.
Creating a Switchboard Menu in Microsoft Access
13:04
Andrew Comeau
Рет қаралды 9 М.
How To Manage User Authorization and User Access in Access 2013 🎓
38:06
Programming Made EZ
Рет қаралды 256 М.
Treeview in MS Access: Part 5 - Right Click CommandBars
17:44
TheSmileyCoder
Рет қаралды 18 М.
Ms Access Dynamic Menu
27:49
Sissoko M. Prodev
Рет қаралды 164 М.
How to Make a Microsoft Access Dashboard
10:14
MyExcelOnline.com
Рет қаралды 24 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12