Access.2007.VBA.Bibl..
Requires a reference to the Microsoft Scripting Runtime library. On Error GoTo ErrorHandler Set fso = CreateObject(“Scripting.Fi ...
MsgBox “Error No: “ & Err.Number _ & “; Description: “ & Err.Description Resume ErrorHandlerExit End If End Function ...
CopyFilemethod of the FileSystemObjectis used to copy the current database to a backup with the final save name in the Backups f ...
FIGURE 9.10 A form with options to create a text file with information about skipped records using three different methods. The ...
Dim blnSomeSkipped As Boolean Dim intTextType As Integer Dim strTitle As String Dim strPrompt As String Dim txt As Scripting.Tex ...
Delete existing file, if there is one. Kill strFile On Error GoTo ErrorHandler Select Case intTextType Case 1 ADO Set tstr = New ...
If strTest = “” Then blnSomeSkipped = True strText = “Contact No. “ & lngContactID _ & “ (“ & strFullName _ & “) ...
Get Contact ID and name for reference. lngContactID = Nz(lst.Column(0, varItem)) Debug.Print “Contact ID: “ & lngContactID s ...
Write final line. strText = “End of File” txt.WriteBlankLines Lines:=1 txt.WriteLine Text:=strText Case 3 VB Open text file for ...
If strTest = “” Then blnSomeSkipped = True strText = “Contact No. “ & lngContactID _ & “ (“ & strFullName _ & “) ...
File is already open; close it. Close #1 Resume Else MsgBox “Error No: “ & Err.Number _ & “; Description: “ & Err.De ...
FIGURE 9.12 An email message created from code. ADO ............................................................................ ...
FileSystemObject .......................................................................................... The FileSystemObject ...
FIGURE 9.13 A form with a choice of loading data from a text file using three different methods. FIGURE 9.14 Selecting a text fi ...
The cmdLoadData_Clickevent procedure that reads data from a text file is simpler than the code that writes data, because two of ...
.Open .LoadFromFile strTextFile .Position = 0 strData = .ReadText(adReadAll) End With Close Stream object. stm.Close Case 2 FSO ...
Write data to text box on form. Me![txtImportedText].Value = strData ErrorHandlerExit: Exit Sub ErrorHandler: MsgBox “Error No: ...
FIGURE 9.15 A form with data loaded from a text file, using the FileSystemObject method. Working with Attachment Fields ........ ...
I discussed using the FileSystemObject(Scripting Runtime library) for working with folders in an earlier section of this chapter ...
FIGURE 9.18 Selecting a TIF file in the Choose File dialog. If you store multiple files in an Attachment field, only the first f ...
«
11
12
13
14
15
16
17
18
19
20
»
Free download pdf