Solved Multiple search engine with dropdowns (1 Viewer)

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
Fixed, and now i get this error
 

Attachments

  • ScreenShot003.jpg
    ScreenShot003.jpg
    424.9 KB · Views: 106

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
@MickJav,
Here are two versions of the same thing. One uses the MSCOMCTL Treeview. The other uses the JKP MSFORMs version.

@zelarra821,
You can delete all references to LongLong in that code, or delete this module and import the query utilities that you have been using in the Libros database.
 

Attachments

  • ReadFiles.zip
    870.3 KB · Views: 138

Dreamweaver

Well-known member
Local time
Today, 19:50
Joined
Nov 28, 2005
Messages
2,466
@MickJav,
Here are two versions of the same thing. One uses the MSCOMCTL Treeview. The other uses the JKP

Thanks @MajP I'm just finishing up my music library I then have some updates to add to my personal project system after that and before the next planned project I'll revisit the code library and look at using you tools thanks for all the help
Mick
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
FYI. The MSFORMS is OK, but not sure about very large trees. It is definitely slower and I have hit limits.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
@zelarra821,
I need to relook at my file and folder counts. I was only counting the immediate children, not all the sub folders and sub files.
That will have to be done in the original reading of the directory since it needs to get done in the loop and stored somewhere. You cannot do that after the fact with a query, because it has to be a recursive count.
 

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
@zelarra821,
I need to relook at my file and folder counts. I was only counting the immediate children, not all the sub folders and sub files.
That will have to be done in the original reading of the directory since it needs to get done in the loop and stored somewhere. You cannot do that after the fact with a query, because it has to be a recursive count.
OK, when you get something, post here. Thanks
 

Dreamweaver

Well-known member
Local time
Today, 19:50
Joined
Nov 28, 2005
Messages
2,466
FYI. The MSFORMS is OK, but not sure about very large trees. It is definitely slower and I have hit limits.
I wouldn't expect more than 200-300 Code records But will test with more thanks
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
This demo does a lot more than you are asking. It reads the directory and gets all the file details and the summary counts for the folders and writes this to a table. I create a detailed treeview and a summary treeview. You will have to figure out what functions you want. I store much more information than was asked.
 

Attachments

  • GetFiles.zip
    852.5 KB · Views: 140

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
Hi. Thank you very much for your interest trying to improve what was already very good.

It gives me an error when I enter the database. I have recorded a video for you to see the error, and the steps that I take.


A question. Does the path default to the one where the database is located?

Thank you.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
That looks like the same issue with the Reference to MSCOMCTL.OCX. Make sure you do not have a broken reference, now that you added to your system. I will make the same version with the MSFORMS control. The folder defaults to the database files folder within the folder.
 

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
About the reference, two things. The first is that I directly copied the file into System32, after unzipping the downloaded link, so if it is corrupt, Microsoft has a problem if it offers files in bad condition. The second is that I don't know how to check if it is corrupt or not.

About the route, I find it difficult to understand what you put, but I deduce that it takes the route where the database is. Couldn't you put in the code a procedure where the path is stated, either the database path, or any other path, and that when it is needed for something, take it from that procedure?

Thanks a lot
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 19:50
Joined
Sep 12, 2006
Messages
15,655
A really easy way
In the form header or footer of a continuous form have 2 buttons. (you can use it with a single form, but it's easier to see with a continuous form).

Call one "apply filter" - there's a built in graphic for this if you prefer.
Call the other "remove filter" - again, there's a graphic available.
you might want error handling in case the command isn't available.

Click in whatever your interested in, first THEN click the "apply filter" button.

use this code
screen.previouscontrol.setfocus 'this jumps back to the field you wanted
runcommand acCmdFilterBySelection


"remove filter" button.
Simply
Code:
"filteron = false"

The filter is successive. You can keep zooming in by successive selections. It doesn't let you use the flexibility of the filter options demonstrated by @MajP , but on the other hand, it's dead easy to programme as a basic function. It also saves you time programming what the users might want, and just lets them use whatever they want by themselves.

if your form has some totals, you will see these changing to reflect your applied filters
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
Bbout the route, I find it difficult to understand what you put, but I deduce that it takes the route where the database is. Couldn't you put in the code a procedure where the path is stated, either the database path, or any other path, and that when it is needed for something, take it from that procedure?
You need to read the code more carefully. I show you how to do exactly that. I provided tblAppicationSettings where you could store the default path. Normally you would have a folder browser to do this if the path changes often. Or at least a form to provide the path. I will provide you a folder browser. Then you read the default path from the table. Look at my comments in the GetDefaultFolderPath.

Code:
Public Function GetDefaultFolderPath()
  'For Demo use the current project path
  'If not you would read from the applications table using a dlookup
  GetDefaultFolderPath = CurrentProject.Path
End Function

Public Function GetDefaultFolderName()
  GetDefaultFolderName = DLookup("defaultFolderName", "tblApplicationSettings")
End Function

Public Function GetDefaultFolderFullName()
  GetDefaultFolderFullName = GetDefaultFolderPath & "\" & GetDefaultFolderName
End Function

The first is that I directly copied the file into System32, after unzipping the downloaded link, so if it is corrupt, Microsoft has a problem if it offers files in bad condition. The second is that I don't know how to check if it is corrupt or not.
I am not suggesting the reference is corrupt. That might have been lost in translation. I was saying it may need to be selected again. Like how you made it work the first time. Your error message suggests a broken reference to MSCOMCTL.OCX
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
I combined both the ActiveX and the MSForms into one db. This way if you cannot get the Active X (MS Common Controls 6.0) to work you can use the MS Forms version
When I get time I will do the folder browser so you can pick the default using a browser.
 

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
Hi. Thanks for the explanation.

I have managed to load the files but skipping the errors that gave commenting them. I have had to do it with ClearFiles.

Once I had it loaded, I have activated another ClearFiles, but it keeps giving me the error that the object is not found in this line:

Set TheTree = Me.xTree.Object

I have re-set the reference, but it doesn't fix anything either.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
I forgot to post the combined version. Here it is. I also added the file chooser. Please look at the code for getting the default folder. Try the MSFORMS treeview instead. Both are in here
 

Attachments

  • LogFileDirectory V1.zip
    660.7 KB · Views: 121

zelarra821

Registered User.
Local time
Today, 20:50
Joined
Jan 14, 2019
Messages
809
Thanks a lot. This version does work for me.

Questions:

1. Can hidden and system files be removed?
2. In Summations, I don't understand this: Folder x / x, Files x / x. Why does it get two numbers?
3. The Control Tree Demo has nothing assigned.
4. In the tree, can columns be added? I thought it was a list box, but no.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:50
Joined
May 21, 2018
Messages
8,527
1. Can hidden and system files be removed?
Yes the filesytemobject has attributes. I will add the code.
2. In Summations, I don't understand this: Folder x / x, Files x / x. Why does it get two numbers?
I showed the Local folders and files and the total. Mainly for error checking. You can display whatever you want.
Folder 6/34 means 6 folders directly within the given folder and 32 total subfolders.

3. The Control Tree Demo has nothing assigned.
I do not understand
4. In the tree, can columns be added? I thought it was a list box, but no.
It is a tree view. Each node has text. So you cannot add coumns. I do not know what that would look like.

Again, you may not need or want any of the treeview. Just a bonus to show how to span a directory. You may only need the counts for your original request. If so, this can be sped up a lot since it is storing a lot of information you did not ask for originally.
 
Last edited:

Users who are viewing this thread

Top Bottom