Modules & VBA :: Optimizing Tree View Of Large Database
Oct 24, 2014
I have a form with a Treeview in. I have it populated from a self-referencing database using the following code.
Code:
Private Sub Form_Load()
Const strTableQueryName = "SELECT * FROM tblHierarchy ORDER BY tblHierarchy.Function_Parent;"
Dim db As DAO.Database, rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(strTableQueryName, dbOpenDynaset, dbReadOnly)
[Code] ....
The database this is referencing is about 30000 lines and it takes ~4 minutes to populate this way. I know Treeview isn't really supposed to be used in this way however it's what is required.
Now I have come up with the theory that I will populate each node with children as its clicked to be expanded.
Table 1: two columns - Child Tag and Parent Tag. Parent Tags can also be in Child Tag column. In other words, a parent can have multiple levels of children.
Table 2: one column - Backup Tag.
I'd like to have a form with a combo box, pick a Parent Tag, the search all its child tags and compare each Child Tag found with records in Table 2 to see if there is a match. Then populate all results in a tree view control.
A visual example :
Parent Tag ...Child Tag 1 - Back up tag found ......Child Tag 11 ......Child Tag 12 - Back up tag found ...Child Tag 2 ......Child Tag 21 ...Child Tag 3 ......Child Tag 31 .........Child Tag 311 - Back up tag found
This problem is driving me crazy.... :mad: I have main form which contains treeview control. TreeView contains list of all users that have been added. I add users in pop up form. But when I hit Update button in pop up form the treeview dosen`t want to update. I can make it work only if I close main form and open it again when I hit Update button on pop up form.
If IsLoaded("frmOsnovnoOkno") Then DoCmd.Close acForm, "frmOsnovnoOkno" DoCmd.OpenForm "frmOsnovnoOkno" DoCmd.Hourglass False End If
I dont want to close main form ("frmOsnovnoOkno") and open it again I just want to update treeview without closing and opening main form. Please help me.. :)
I am not sure if this is the correct forum to post this question but I am trying to create a tree view library reference database for several pdf documents I need to index, and would be happy if there is a sample available to download.
I am not sure if this is the correct forum to post this question but I am trying to create a tree view library reference database for several pdf documents I need to index, and would be happy if there is a sample available to download.
The file was converted from excel. It is in Datasheet view. I select the first column and clip on the Ascending choice under the Home Tab. It works but leaves a large gab of blank rows. I go to the Database Tools tab and check Compact and Repair Database. The file returns to the original unorganized list.
Is there way a to get this audit trail module to work with a form in Datasheet view? It works fine with a form in Single Form view; I can open the table where the audits are saved and everything looks good. But when implemented on a form in datasheet view, nothing happens. I don't get any errors and nothing is saved to the audit table.
Link : [URL] ....
Here's the vba code:
Sub AuditChanges(IDField As String, UserAction As String) On Error GoTo AuditChanges_Err Dim db As DAO.Database Dim rsT As DAO.Recordset Dim ctl As Control Dim datTimeCheck As Date Dim strUserID As String
[Code] ...
You call it in the BeforeUpdate event like so:
Code: Private Sub Form_BeforeUpdate(Cancel As Integer) 'Track all changes made to the record If Me.NewRecord Then Call AuditChanges("Asset_ID", "NEW") Else Call AuditChanges("Asset_ID", "EDIT") End If End Sub
Hi Many thanxs for replies, Like the idea of compacting. We are traveling down the path of setting up a delete query. This will hopefully delete the records but not the structure. We are networked and a computer Warp2, writes data at Midnight to the sever, and then we use access on Windows NT to view the data.
We can then compact to maintain the database and not allow it to grow to 1.6 GB again.
Any ideas on the delete query thingy would be greatly appreciated. :cool: Many thanks for reading this post from a new starter.
I am currently using a large Access 2002 database in order to generate various reports.
My two main tables are despatches and returns from which they hold around 1,200,000 records and 100,000 records respectively.
The problem I have is that the reports use various expressions within various queries to generate a single result (percentages per channel etc.) This is obviously very time consuming and it may take up to around 10 to 15 minutes to get a result from a chain of around 5 queries.
Can anyone suggest alternative methods to generate similar results in quicker time? (Please note that the tables can not be downsized and records can not be archived)
Hi All, please forgive me if I am in the wrong forum.
I have a pretty good size (~6400 table and 700 Mb) single user application. It runs on XP home with office 2000.
It is a financial application (stocks and mutual funds). Each symbol has it's own table. The app ran fine when we were monitoring about 1800 symbols. Now that we are up to 3200, I am getting some odd messages from Access. It can't find tables and also says that tables are opened exclusively by other processes.
Although I do not use explicit transactions, it is like I need a "commit" or refresh of the user table catalog.
Each table has 312 rows (52 weeks / year * 6 years of historical data). So, for half the tables (3200) I do 312 Inserts ("Insert into tablename (col1, col2, etc) values (val1, val2, etc)".
Is there a transaction log that needs clearing? Is there a setting in Access that I need to change?
Hi I have a large database with many tables, forms, queries repost etc. These are stored named and displayed alphabetically, is there a way to place them in folders within access so it is easier to organise and locate as i am developing. Or do i just need to rename them all with a section title as the first part of the name?
Is there a simple way of copying the same data down a column in Access similar to Excel with its Fill Down Column. I have tryed copying down a column and it only goes one cell at a time or if I copy 5 cells with the same data, I can copy it to 5 empty cells.
I am trying to change a field lenght of a large database (access 97) It is at 50 right now and want to change it to 25. When I try to change it and save the table I get a error when the bar is about 3/4 the way accross the bottom.
Microsoft can't change the data type - there isn't enough disk space or memory.
then
not enough space on temporary disk
This is error 3183. In the help it says that the TEMP DOS enviroment variable location doesn't have enough space. (summerising). Now I have a 100+gb drive that isn't close to being full. I also changed the MaxLocksPerFile registry dword to 8,000,000 as my table has around over 3 million records. I have tried this on a xp and 2000 machine same results. Next I am going to try it on a 98 machine. I could do it by breaking up the table into 2 differnt ones and do each one individually but there is an autonumber field used as a reference number (I know I know). So that would screw up the numbering scheem (Yes I know there are ways arund that also). this database is about 400MB
Couple of questions 1. Is there a way around this? I have not found a solution on line yet. 2. Will lowering the field length make the database smaller (the data that is in there now is less than 25 charecters and the field is set to 50.) I have gotten mixed info on this. there are a few fields I would like to reduce.
Hi there, I've developed over the past 3-4 years a database holding data relating to workload figures for my place of work. It has grown to a large size (eg. one table holds 1-2 million records). I've been trying to run a particular pivot table based on the sql query below:
SELECT Tests.Test, Year([DAUTH])+(Month([DAUTH])<4) AS FYear FROM Sets INNER JOIN Tests ON Sets.SET = Tests.[Set Code] WHERE (((Sets.DAUTH) Between #4/1/2003# And #3/31/2007#));
When I try producing a pivot table using the above query it takes forever - has it running for over 8 hours last night - then access closed down with a runtime error. Does MS access have a problem with large databases? Is there any way I can improve the efficiency / speed of access with a download add-on? Or, will I have to resort to using something like MySQL on a LINUX OS which has fewer demands on system resources when using large databases.
Any help would be much appreciated. Thanks for reading.
I am trying to clean up one field of a large database. Currently this field has many records that are listed as "XXXX, Inc.". I am trying to find a way to change all of those to "XXXX Inc" in the entire database.
I saw raskews code snippet on changing multiple characters in a string, but I have to admit I have only use VBA in Excel before and having a hard time with the basics.
Does anyone have some code or ideas on how to do this or something similar? :confused:
Currently, I have the following query being run against a table holding what is essentially an access log for a rather elaborate system. I have been doing lookups against the log to determine last changed and created dates/times. The log has grown large enough that the lookups I am doing are taking too much time to perform. Is there any way to get at the data I want faster, barring adding created/modified fields to the individual records in every table, and storing the data there as well?
Here is the current query:
SELECT Min(SecurityLog.Date) as Created, Max(SecurityLog.Date) as Modified FROM SecurityLog, WorkOrderLineItems WHERE (Len(SecurityLog.Param2) <= 4) AND (WorkOrderLineItems.PONumber = '" & PONumber & "') AND CStr(SecurityLog.Param1) = CStr(WorkOrderLineItems.WorkOrderNo) AND CStr(SecurityLog.Param2) = CStr(WorkOrderLineItems.LineNumber);
Param1 and Param2 are Memo fields, Whereas WorkOrderNo and LineNumber are numeirc field, to explain the funny type conversion.
This was good enough for a long time, but as the SecurityLog table is reaching a quarter million entries, it's starting to cause some problems.
Does anyone know if it's possible to make the column heads, column count, column width properties of a list box fit automatically according to the text they hold?
Hello, I am new here and needed a little help if you wouldn't mind.
I've built an application for a company that I also use for other work I do for them. I have several tables, queries, forms, and a few reports. I have a lot of VBA code behind the scenes. The application is about 6 mbs. When accessing it over the VPN the application runs really, really slow. I need to find a way to increase the speed of the application so that everyone can work in it without the huge delays. Obviously, it runs normally locally.
I know it's a long shot, but, in A2010 I'm trying to convert a series of Word doc files into pdf, BUT then assemble them into one large PDF. It's for a sort of archiving system.
way I can do this, preferably just using the PDF capabilities within Access and without purchasing any Adobe Pro software.
I need to fill in 200000 records counting from 100000,100001,100002.... and so forth, just one column (and maybe the auto numbering).
make a new DB with these columns: ID, counter set counter to 100000 where ID=1 (in the first record) move to next record (or make a new record) if ID < 300000 then set counter = 1+ (the value of counter in the previous record) continue until ID=300000
I am attempting to create a metrics analysis table from another table. What I would like to do is copy the structure (only) from table 1 into a new table. Change all the fields in the new table to text (except for an ID field which would be an autonumber). Then run a seperate group by query against each column, counting the values in each group (i.e. first query would have two fields The grouped column and the column count.
Once I have these values I would like to concatenate them (with the count in parens) and then push these values back into the new table under the appropriate column.
My code does this. I basically loop through a recordset that runs to each column/field groups and counts and then Edits the new table with the concatenated data.
My first table is 170 fields and 38K records. The issue is that it's too much for Access to handle and it blows up (on field 123) Telling me the File is too large. The file does explode to 1G. Then I can shrink it back down to 67mb by running a repair and compact... and then run the the data for the rest of the fields in that table. When I compact again I get about 80Mb.
So now I have two tables, both with an ID field... so I try to link them together (via a make table query) and meld them into one table... but it keep running into that "File Too Large" issue.
How can I have two tables in a database file with a combined size of 80Mb, but when linked together are too large for the database file? Does it have something to do with having all text fields?
I looked up the limits to MS Access and the field count doesn't appear to be an issue since it's nowhere near 255... So what's the problem here?