With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.
Private Sub cmdDoSomething_Click() Dim ctlDisplay As Control Set ctlDisplay = Me.txtStatus WriteLog "c:\MyLog.txt", "Stuff is happening", "Global", ctlDisplay End Sub
Public Function WriteLog(LogSpec As String, LogMsg As String, LogType As String, ByVal ctlDisplay As Control) Dim fs, ts, strLogText As String strLogText = Format(Now(), "MMDD:HHNNSS") & " " & LogType & ": " & LogMsg & vbCrLf Set fs = CreateObject("Scripting.FileSystemObject") Set ts = fs.OpenTextFile(LogSpec, 8, True, 0) ts.Write strLogText ts.Close Set ts = Nothing Set fs = Nothing If Not IsEmpty(cltDisplay) Then ctlDisplay.Text = strLogText & Left(ctlDisplay.Text, 2048) End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.