Hi ADezii;
Q1- the code works on my form with the exception that sometimes i get an error because the results from all the sub folder search is too big for the list box (it returns the complete file path for subfolders) - so I would like to display only the text from the return search that comes after the filepath (txt), into the listbox -
Q2 - the code works on the form just fine, but does not work on a report - does not get...
User Profile
Collapse
-
Populate lstBox dynamically on a report -
two questions: 1 - i am using this on my form to populate the lst box showing sub folders, works fine but i need to show only the information after txt in the lstBox and 2- i would like to use this code in creating the report in ms access but report won't accept add function because it is in print mode - is it possible to work around this? many thanks
Code:Dim Fso As Object 'to hold FSO Dim fmain As Folder
-
ADezii!I would like to have the option, because I don't have control of the folders after the filepath in the db and 'stuff' gets put in there (which I realized as I was running the code) - so yes, that would be great. The best of both worlds is as good as it gets! Thank you.Leave a comment:
-
Hey ADezii, not to worry, I didn't realize it would be helpful, but can work around it. Also, took a quick look at the zip file on Thursday, and will look at it more carefully today and tomorrow. Thank you.
kLeave a comment:
-
-
I had the RowSource.... I put the code on a button, and it sort of works (which means user must click button to see file list) but doesn't clear when going to next record, or give a message if no files etc. Do you know what is wrong?Leave a comment:
-
It is so weird, I have tried many approaches and it does not work. Do I have to do something special with the list box properties? or is the Private Sub incorrect. The list box works if i reference a stored query in the RowSource, but does not get the info from the code.
Private Sub Form_Activate()
Dim lst As ListBox
Dim txt As TextBox
Dim strFileName As String
Dim strPath As String
Set lst = Me![lstFilesInDirec tory]...Leave a comment:
-
-
katia started a topic populate a list box with the files in a folder - filepath is in memo field on formin Accesspopulate a list box with the files in a folder - filepath is in memo field on form
Hello;
I am stuck, and would like to resolve my problem.
Am using Access 2003
- I have a form that has the file path in a memo field.
- I have a list box for the list of files in the folder for the filepath
- When I move to the record, I would like the listbox to populate with the most recent files in the folder from the file path that is on the the form
- Sometimes there is no file path, or an invalid one, so need
-
FYI: is populating but with a list of sequential numbers, if you click on the list box - gets compile error: method or data member not found. (lstFilesInDire ctory.PathLeave a comment:
-
' problem with DLookup and lstFilesInDirec tory.Path is
' errors - why? *sharp stick in eye*
Dim FILEPATH As String
FILEPATH = DLookup("[File Path on Network]", " Records Investments Group") = Form![Records Investments Group ALL Fields]
lstFilesInDirec tory.Path = FILEPATH
Dim i As Integer
Dim TEXTCONT As String
For i = 0 To lstFilesInDirec tory.ListCount...Leave a comment:
-
Hello Guido;
Thank you. I have tried this but it does not work. I have the File1 = using DLookup - is this the wrong approach? It gives me errors and does not like it as file path.........
Dim File1 As String
File1 = DLookup("[File_Path_On_Ne twork]", "[Records Investments Group]")
Dim i As Integer
Dim TEXTCONT As String
For i = 0 To File1.ListCount - 1
TEXTCONT -TEXTCONT...Leave a comment:
-
katia started a topic need help to get file list onto form - using filepath from field on active formin Visual Basicneed help to get file list onto form - using filepath from field on active form
i am lost. i cannot figure out how to make this work, because the dir= is not static but changes every time the form loads, and so, would appreciate help.
i have an access database 2003 (vb)
and one of the fields in the database contains the filepath for objects that are stored in various places (could be mp3, doc, pdf, xls - etc)on the drive.
i have a form that displays a record, including (among other...
No activity results to display
Show More
Leave a comment: