How Would I List Out Some Sub-folders?

Dec 14, 2005

I need to get a list of about 110 subfolders from within a folder. I searched high and low on this forum, but didn't see what I was hoping to find.

I tried putting a little Function together, but it gives an error. Here's the routine, and I commented the line that gives me an error:

Option Compare Database
Option Explicit

Public Function ListFolderss()

Dim strDBName As String

Dim rst1 As DAO.Recordset

Dim MyFile, MyPath, MyName

Set rst1 = CurrentDb.OpenRecordset("APCSProcess")

MyPath = "\Jana-dp-dataprojectsHoneywell-IHCSundstrand Legacy DataAPCS (Files for Conversion)"

MyName = Dir(MyPath, vbDirectory)

Do While MyName <> ""

' Ignore the current folder and the encompassing folder.
If MyName <> "." And MyName <> ".." Then

'**** This next line causes a 'File not found' error
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
'****
rst1.AddNew
rst1!NameOfDataBase = MyName
rst1.Update
End If
End If
MyName = Dir
Loop

End Function

If any of you smart, intelligent folks would please either look at my code and advise me on the error of my ways, or suggest an alternative, I would be very grateful. Thank you in advance.... looking forward to your replies!

View Replies


ADVERTISEMENT

Getting A Complete List Of Files And Folders

Nov 26, 2006

I'm trying to get a complete list of folders within a given Folder but can only get it down to the level of the main folders sub folders but should a sub folder also contain folders it misses these.

My code below builds a list like:

c:fld1fld2fld3

This function is used to fill a combo box


Function ShowFolderList() As String
Dim fs, F, f1, S, sf, All, AF, FC, sb, sb1, sbf, sbc
Dim Lst As String
Lst = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set F = fs.GetFolder(Me![FoldersRoot] & Me![StartInFolder])
Set sf = F.SubFolders
For Each f1 In sf
Lst = Lst & f1 & ";"
Set sb = f1.SubFolders
For Each sb1 In sb
Lst = Lst & sb1 & ";"
Next
Next
'Now Remove The Last ; If Their
If Right(Lst, Len(Lst)) = ";" Then
ShowFolderList = Left(Lst, Len(Lst) - 1)
Else
ShowFolderList = Lst
End If

End Function

View 3 Replies View Related

Tab 'folders' On A Subform

Sep 25, 2005

Quick question,

Is it possible to change the default color & weight of the headings on the tab folders? If so, I can't find it. :(

THanks,

Aqua

View 1 Replies View Related

Image Linking To Folders...again!

Oct 5, 2005

Hello,

I am sorry to post this as I did do an extensive search through the forums. I am looking for a way to link images to a form from an image folder I have created outside my database. As I said, I did do a search and there is a lot of information listed. For some reason, I understand non of it. I am a bit of a novice as my personal database is quite simple.

Below is a screen grab from my database showing how I want to link my images; how I want them to look. This image is taken from an old incarnation of my database when I thought I was linking images but in fact was storing them on my computer. Like I said, I am sorry to bring this up but all of the help is a little over my head, of someone would not mind telling me VERY simple steps to achieve what I want to do, I would be very appreciative.

I want to be able to have the pictures change for each record.

http://i18.photobucket.com/albums/b117/Gregbert/Database1.jpg

Take care,
Greg

View 5 Replies View Related

Modules & VBA :: Make Folders From Query

Feb 23, 2015

I am trying to make some folders from a Query list to my C drive.I found this code for making folders. I have a button on a form with this code. It works with making a folder but only gives me the first item in the query out of many rows. It is missing the rest of the items.Also I would like it to be able to make Sub Folders too from this query.Here is the code I found.

Private Sub MakePreservationTagFolder_DblClick(Cancel As Integer)
Dim strFolder As String
strFolder = "C:UsersryanDocuments" & "Tag - " & DLookup("[Tag]", "Tags Qy")

[code]...

View 13 Replies View Related

Forms :: Treeview For Client Folders?

Aug 8, 2013

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.

View 1 Replies View Related

Modules & VBA :: Create Folder And Sub Folders?

Jan 30, 2015

I have the below code to create email and folders based on data from the database. For now, I'm able to create the main folder and add a word document inside. What could be changed on the code or added to add 2 sub folder named "Documents" and "Correspondence"

Greetings.

Code:
Option Compare Database
Private Sub SendEmail_Click()
On Error GoTo Err_open_word_Click

[Code].....

View 6 Replies View Related

Access Collection Of Files And Folders?

Nov 12, 2011

Is there a good way to let Access be the database for collections of files and folders (on a Windows PC) that would organize projects and give information about the files. When I say information I mean description, progress(check in & check out duration of work, and timers), and location. I think this would work with organizing our projects and knowing what file is the current one we should be working on when we have many. A while ago I was working in FileMaker and noticed that one of there template options said "Collection of Files".

View 1 Replies View Related

Modules & VBA :: 3 Separate Folders To Send PDF Files

Aug 12, 2015

the code below sends 3 reports to a folder that the vba creates if needed. I would like to change it so the 3 reports go to different folders and creates a folder with the customer name in each of the below folders if needed at present it looks table with one folder address is as I dont know how to make it look up the 3 different records in that table so I would like to just put the 3 folder address in the code

1. ' varFolder = "C:UsersUserDocuments invoice"
2. ' varFolder = "C:UsersUserDocumentscofc"
3. ' varFolder = "C:UsersUserDocumentsdespatch

Code:
Private Sub cmdPDF_Click()
On Error GoTo Err_Handler
Const FOLDER_EXISTS = 75

[Code].....

View 2 Replies View Related

Tables :: Linking Multiple Individual Folders

Nov 6, 2014

I am using Access 2010 and I am fairly new to it (started using it for work).

I have a table with a bunch of a agreement numbers (134) and I need to link each one to its folder on our company's shared G drive. The agreement numbers all follow the format A12.## (Where ## is the number of the agreement going from 1-134).

So I have the path to get to the location of all the agreement files, and I know there has to be a faster way than to edit each individual hyperlink, I myself just don't know how to do it.

Also the files on the shared drive start with the A12.## but then also continue with the name of the agreement. I was thinking that somehow for each record you could apply all at once the same path to the agreements and then for each individual record get it to search for its closest matching agreement number?

View 5 Replies View Related

Modules & VBA :: Extracting XML Data From Multiple Folders

Jul 1, 2015

I have over 500 folders that contain XML files in each folder. I need to go through each folder and append the data from the XML files into my database.

View 1 Replies View Related

Importing Outlook 2010 Folders Into Access

Jan 22, 2013

I have been trying to import Outlook (2010) floders into Access 2010. So far, I have only been able to import 1 folder at a time. I have also tried linking the access database to Outlook, not much luck there.What I was wanted to do was import the pst / ost file into access and then work from there.is there a way to import the Inbox and all sub-folders at one time.

View 3 Replies View Related

Modules & VBA :: Find All Files / Folders In A Specific Directory

Sep 1, 2014

I'm using a function to find all files/folders in a specific directory, then copy each one to a specific destination folder. I'm going to use this on a weekly basis to backup files on a computer. I would like to use the vbarchive in GetAttr/SetAttr so I only need to copy these if they have changed since last backup.

Something like:

If GetAttr(strFile) And vbArchive = 32 then
filecopy xxxx, xxxx
else
rs.movenext

As I understand it, a value of 32 indicates that the file has been modified since it was last backuped up (i.e. since the file attribute was "reset"). How do I "reset" the file attributes to clear the vbArchive?? I've read some google searches and the only thing I could find was the files were set to vbnormal however I'm concerned that this will erase program files that are vbReadOnly or VbHidden.

View 5 Replies View Related

Modules & VBA :: How To Use Treeview Click Event To Show Pictures In Folders

Dec 10, 2014

I have been looking into populating a tree-view with folders and files, and have found some great examples for doing this, How ever...I cannot seem to work out how to show files/pictures in a form based on the click event of the tree-view.

I have managed to do an onclick event for the files in the tree-view, but I cannot seem to get the onclick event for folders in a tree-view.

Here is an example which I am working on at the moment, but get the error Object variable Or with block variable not set.

Code:
Private Sub tvw_Click()
Dim tClient As String
Dim tParent As Scripting.folder
Dim fd As Scripting.folder
Dim fNode As MSComctlLib.Node

[Code] .....

View 14 Replies View Related

Modules & VBA :: Count Number Of Text Files In Directory Sub Folders

Mar 14, 2014

create/find code that will count the number of text files in a directory with one level of folders please see below:

Directory path is : B:

First and only level of sub folders:

there are 100 of these and they all end in ".fof"These .fof folders will always contain .txt files.I've tried using the following code, but it always returns No files found.

Code:

Dim lngFileCount As Long
Dim StrFileName As String
StrFileName = Dir$("B:*.txt")
Do While Len(StrFileName) <> 0

[code]...

View 1 Replies View Related

Modules & VBA :: Create And Open Variable Folders With Link Created In Access Query

Aug 5, 2014

I am trying to set up something to be able to take me to a folder that holds various forms for personnel. I have a query that generates the link for each person. I have tried to set it up as a hyperlink in ACCESS 2013 and it displays as one but doesn't act like one.

I want to be able to click the link and have it open up a personnel folder for that individual. I can't find a MACRO that I can create to do it. Example of my query is that it creates a link K:Main BreakdownSection BreakdownPersonnel FoldersName and the name is the variable part.

My next problem will be to have it create that folder when we have new personnel arriving.

I would also note that I have not worked with ACCESS in many years and much of what I was able to do with 2002 and 2003 doesn't work with the newer versions of ACCESS.

View 3 Replies View Related

Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View 5 Replies View Related

Create A Randomise List From A Table And Save The List For Each Month

Dec 14, 2006

Hi All a newbie here so any help will be appreciated,

sorry for the long post but trying to give you all the information you might need.

I wrote a basic access database for my Church to aid in a paperwork audit for a charity food drop which we do monthly to give free food to the needy.

But each month it gets harder to find out who was in line first so I thought with all your help we may be able to randomize the names each month in a different order as to avoid confusion and also avoid people waiting in line as they turn up at 5am and we don't start until 9am.

So if this will work in access they can all come for 9am

I don't mind creating a new database and adding the additional information, if that's what it would take.

My Background I have created basic databases from scratch not using wizards, But I don't know much about code or how to implement it so any help in where code goes it would be very much appreciated.

Database details (Microsoft Access 2002 version)

Table Name = details
Field name = ID (auto-generated)
Field name = FirstName (text)
Field name = Surname (text)

If possible it would be nice to keep a record of the randomized lists (in the database somewhere ?) each month in case anyone wants to see it or disputes the lists, where I can just create a report to show the details.

There will be approximately 90 to 125 names.

Thank you in advance for all your help in this matter

Britgent

View 1 Replies View Related

Reports :: Exclude Individuals From False List If They Are In True List

Jul 15, 2013

I have created my tables and form and am now trying to run reports to organize the data. I have figured out how to group the individuals by group and treatment, but can't figure out how exclude individuals from the final list if they are already in another. As background, some of the individuals are eventually excluded from the experiment, though I keep the initial data. When the exclude individual checkbox is checked ("True" on the report) I do not want the individual to be listed in the "False" list, even though there are entries for that individual when that checkbox wasn't checked (when it was "True"). This is so I can get an idea of the current totals in each group.

Implant Period
>Treatment
>>Exclude individual?
>>>Individual ID

I feel like this should be a fairly simple task, but I cannot figure it out... Maybe there is coding to exclude individuals from the "False" list if they are already listed in the "True" list?

View 4 Replies View Related

Use Multi-select List Box To Filter A Report With Two List Boxes

Nov 20, 2013

Allen Browne's "Use a multi-select list box to filter a report" solution, in particularly with two multi-select list boxes? The code works fine for me for either box so long as I code it for one box alone. Combining the two into one code results in a type mismatch error. I'm trying to use the code to pass the contents of both multi-select boxes as Where conditions to a report. Both boxes are based on number fields. To try to isolate the problem, I've removed Allen's setDescription and OpenArgs conditions. We're unfortunately still on Access 2003 as the company desires to squeeze every dime by using until end-of-life next year.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_Handler
'Purpose: Open the report filtered to the items selected in the list box.
Dim varItem As Variant 'Selected items

[Code] .....

View 14 Replies View Related

Created List Box With One Column - Display All Characters Of List Item

Jan 2, 2014

I have created listbox with one column (contains one column only), now i would like to display all the characters of list item (want scroll bar to listbox).

How do i display all text of list item, I have already fixed Column Widths to max length (22";0.1"). However when scrolling to right, it is going to next blank column of list box, which is created only to change Column Widths property.

View 12 Replies View Related

Queries :: Return List Of Records From Original List

Apr 23, 2013

I'm looking to move an excel sheet to access because the row counts are too much.The main thing it does is compare the supplied data against a list I hold in the sheet.There are not duplicate records, however..Some data is a direct lookup for a full match, but much of it is a count to see how many records contain a certain string.

I have 500 keywords which have a countif function in using wildcards.I need to create a query/report which will return a list of records from the original list which contains each keyword featured and how many times it features.I was going to do it in PHPmysql but the time it took to parse a million records for every keyword made it pointless.

eg:
keywords:
look
billy
magic

list:
"have a look and see"
"spanish dave"
"who is billy brag"
"looky looky I go hooky"
"who's the man from argentina"
"could it be magic now"

my spreadsheet would return a 1 next to ""billy" and "magic" and would put a 2 next to "look".

the sheet has the keyword in each row and next to the column:
=COUNTIF(list,CONCATENATE("*@",B13))
where "list" is the external data.

View 3 Replies View Related

How To Transfer Multiple Select Item In List Box To Another List Box

Jun 2, 2012

How To Transfer MultipleSelect Item In Listbox to another Listbox ?

View 7 Replies View Related

Select From List BOX Of List Of Choices And Store This Into A Table

Aug 21, 2013

I created a form and created on it a list box which is a query that grabs certain number of fields from different tables. I would like the user to select from this list box of a choice and then store their selection into a table.This list box has three fields, but it needs to store the id rather than the item, the user would see the name of the item but the id of the item would be store into another table, called bid. It store all these three fields when a user selection one of the item from the list.

View 13 Replies View Related

List Table, Limiting Field List..

Oct 14, 2006

Okay,

The subject is probably confusing but I'll try to explain.
Setup:

Table1
FieldID = Number
FieldName = Text

Table2
FieldID = Number
FieldName = Text
T1_ID = Number

Relationship
Table1.FieldID 1-> * Table2.T1_ID (one to many)

Now, I'm trying to create a 3rd table that has field populated by Table1 and a field populated by Table2 but I want to limit the field populated by table2 by what is selected in the field populated by table1.
Table1:

1st
2nd
3rd
4th

Table2:

1st,January
1st,February
1st,March
2nd,April
2nd,May
2nd,June
3rd,July
3rd,August
3rd,September
4th,October
4th,November
4th,December


Table3:
Table1Field = Number, ComboBox-Source: Table1, BoundColumn=1
Table2Field = Number, ComboBox-Source: Table2, BoundColumn=1

If Table1Field = 1st then
Table2Field Will only allow January, February, or March as selections, since ONLY they are a member of the "1sr" group via the table1 list.

Is this possible, or do i have to do some run-time checking or something?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner

View 1 Replies View Related

Forms :: List Box - Selection - Populates Next List Box

May 20, 2013

I am wanting to preempt data in list boxes

listbox1
Fruit
Vegetable

listbox2 (If Fruit Is Selected)
Apple
Banana
Orange

listbox2 (If Vegetable Is Selected)
Potato
Peas
Carrot

If Fruit is selected in Listbox1 - Then Listbox2 should have the options
Apple
Banana
Orange

If Vegetable is selected in Listbox1 - Then Listbox2 should have the options
Potato
Peas
Carrot

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved