Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO 'imports the system.io library to be used
- Module GetFile 'creates a global module called GetFile
- Public staffFile As String 'creates variable to hold the staff textfile location
- Public Security As Integer 'creates variable to hold the current user's security level
- Public Sub getfilelocation() 'creates a subroutine to set the staffFile variable to the location of the textfile
- staffFile = Application.StartupPath & "\staff.txt" 'makes the staffFile variable store the file path
- If Dir$(staffFile) = "" Then 'if the staff textfile doesn't exist:
- Dim sw1 As New StreamWriter(staffFile, True) 'the streamwriter is opened to create the file at the location
- MsgBox("Staff File created") 'confirmation message shown
- sw1.Close() 'closes the streamwriter to prevent data being deleted
- End If
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement