VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Command1click

by Daniel Bennington (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

Allows you to backup a source file and have the destination file name be the current date. Great for database backups!

Assumes
Create a new form, create a field called text1 and a field called text2. Also create a command button called command1. Change Source directory to your database directory name, change source file name to your database name, and change the destination directory name to the location you want the database file backed up to..

Rate Command1click

- Put this on form load...
Private Sub Form_Load()
Dim MyDate
MyDate = Format(Date, "dddd, mmm d yyyy")
Text1.Text = "C:\SourceDirectory\SourceFile.mdb"
Text2.Text = "C:\DestinationDirectory\" + MyDate + ".mdb"
- Put this on Command1 Click...
Private Sub Command1_Click()
FileCopy Text1.Text, Text2.Text

Download this snippet    Add to My Saved Code

Command1click Comments

No comments have been posted about Command1click. Why not be the first to post a comment about Command1click.

Post your comment

Subject:
Message:
0/1000 characters