473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Folders...

lee123
556 512MB
how do i create a folder once i have a program i have been trying to figure out a way to do this so it doesn't keep trying to create it every time i open up the program here is my code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     Dim fso As New FileSystemObject, fldr As Folder
  3.     Set fldr = fso.CreateFolder("C:\Program Files\My Bill Backup Files")
  4. End Sub
so everytime i click on this button it dosen't say "File Already Exist"

Expand|Select|Wrap|Line Numbers
  1. Private Sub ProcessBtn_Click()
  2. Dim Answer As Integer
  3. Dim ff As String
  4. ff = FreeFile
  5. Me.Refresh
  6.    Open "C:\Program Files\My Bill Backup Files\BillFileSaverBackup.log" For Append As #ff
  7.         Print #ff, "Bill Saver Backup Log" & " " & vbNewLine
  8.         Print #ff, "Date Filed:" & "          " & Date
  9.         Print #ff, "Bill Name:" & "           " & BillName
  10.         Print #ff, "Date Paid:" & "           " & DatePaid
  11.         Print #ff, "Amount Paid:" & "         " & AmountPaid
  12.         Print #ff, "Reference Number:" & "    " & ReferenceNumber
  13.         Print #ff, "-------------------------------------------------"
  14.       Close #ff
  15.     Answer = MsgBox("Do You Wish To Put Anymore Bills In The Filing Cabinet?", vbYesNo + vbQuestion, "Whats Ur Response...?")
  16.     If Answer = vbYes Then Adodc1.Recordset.AddNew
  17.     Adodc1.Recordset.MoveNext
  18.     If Answer = vbNo Then Exit Sub
  19.     If ProcessBtn Then
  20.         Label5.Caption = "Thank You!"
  21.         Picture1.Visible = False
  22.         Picture2.Visible = True
  23.     End If
  24. End Sub
any input would be useful to me at this point..thanks in an advanced

lee123
Jan 31 '10 #1
1 1134
vb5prgrmr
305 Expert 100+
Expand|Select|Wrap|Line Numbers
  1. If Dir("C:\", vbDirectory) <> "" Then
  2.   'exists
  3. Else
  4.   'does not exist
  5. End If
  6.  


Good Luck
Feb 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Karuppasamy | last post by:
Hi I want to populate all the files and folders of System in a Treeview control like Windows Explorer. I try this using File System Objects. But sometimes I am getting an error like 'Access...
5
by: George Hester | last post by:
If I have 1 Virtual Dirctory with 2 different subfolders are these 2 different folders different virtual folders? Or if I have 2 different Virtual Directories each containing a subfolder are these...
1
by: Jason Steeves | last post by:
Does anyone know an easy way to get all of the folders and their sub-folders and their sub-folders and so on? I need to get all of the folders and their paths from an inputted parent folder...
4
by: Noa | last post by:
Hi, Is there a way to use OpenFileDialog1 in order to multi-select folders? I saw in msdn site a sample of multi-file-selections. I need to select multiple folders and to apply an algorithm on...
0
by: Bob | last post by:
Hi, I'm new to Python and I want to create a script that will import contactitems into an Outlook Public Folder. Therefore I've installed the Python for Windows Extensions. This way I can...
3
by: sva | last post by:
Using C# for an application in which I am working on, I need to display the available shared folders on the computer that's running the application. The shared folder paths need to be in UNC format...
1
by: =?Utf-8?B?UmFjaW5yaG9uZGE=?= | last post by:
I had a hard drive failure and had to re-load Microsoft Office XP. When I first loaded, I had no data files so I imported my pst files from my old hard drive and now I have double of everything...
1
NarenMCA
by: NarenMCA | last post by:
Hi, The below code in MS Outlook gives me the names of folders in "public folders". I am looking forward to get all the subfolders and files in "Public folders" Please assist me in this. ...
5
by: Per Juul Larsen | last post by:
Hi. My application creates empty libraries. How do I ensure that the user copies at least one or more picture files (.jpg) in each of the empty folders ? Result , no empty folders! regards pjl
1
by: veer | last post by:
hi it looks a silly question but i m getting confused actually i want to copy folders from one location to another like from C:\abc To D:\xyz here abc and xyz are two folders in c and d drive it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.