Doggie Posted April 11, 2003 Posted April 11, 2003 Display the Current TimeSimply put a label controlin form load event putPrivate Sub Form_Load()labelname.caption = timeEnd Suband if u want it to be updated every second add timer and labelPrivate Sub Timer1_Timer()labelname.caption = timeEnd Submake sure u make the timer interval = 1
Doggie Posted May 17, 2003 Author Posted May 17, 2003 File SystemLike to know how to do such things as delete file(s) and directory(s)? Even create directories etc?Well, take a look what i'm about to write Directory(s)To create a directory, simply use this code;VBA.FileSystem.MkDir "driveletter:\directoryname"eg VBA.FileSystem.MkDir "C:\dogs"simple huh? Maybe u'd like to remove a specifyed directory?VBA.FileSystem.RmDir "driveletter:\directoryname"same type of method with the drive letter and dir namejust a note about this. To avoid errors with this, add the follow to the code;On Error GoTo errLogVBA.FileSystem.RmDir "c:\rabbits" ' This is an example say if it didn't exist so no need to add this :PerrLog:If Err.Number = 76 ThenMsgBox "Directory doesn't exist"End IfTime to use the On Error Goto statement. The example states on an error goto ErrLogWhat this means if the error number = 76, simply mean if the directory doesn't exist, a msgbox will appear saying so.adding more code soon, please be patient
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now