Private Sub cmdImport_Click()
On Error Resume Next
Dim strtable As String
strFile = Nz(Me.txtFile, "")
strtable = Nz(Me.txtTable, "")
If strtable = "" Then
MsgBox "Enter Table Name", vbOKOnly
End: Exit Sub
End If
copystrtable = strtable & "_copy"
strtable = strtable & "_master"
If Right(Dir(strFile), 4) = ".txt" Then
DoCmd.TransferText acImportFixed, "TCCFORMAT", strtable, strFile, False
DoCmd.TransferText acImportFixed, "TCCFORMAT", copystrtable, strFile, False
End If
convert_data (strtable)
End Sub
Private Sub cmdProceed_Click()
DoCmd.OpenForm "Recordchecks", , , , , , Me.txtTable
End Sub
-----------------------------------------
Private Sub Form_Current()
Me.strtable = Me.OpenArgs
End Sub
Private Sub Command0_Click()
Dim strSQL As String
Dim strSQL1 As String
Dim strSQL2 As String
Dim MdTable As String
'Copy the user-defined table and save as BillFile
DoCmd.CopyObject , "BillFile", acTable, Me.strtable
'Move the records from BillFile into a new table for analysis
strSQL = "SELECT BillFile.* INTO [Missing Data]" & _
"FROM Billfile;"
'Delete all records from BillFile and keep fields to write new data into the new table based on
query
strSQL1 = "DELETE [Missing Data].*" & _
"FROM [Missing Data];"
'Run desired SQL query etc.
strSQL2 = "INSERT INTO [MissingData] ....
"FROM BillFile "....
'Date stamp the MissingData table.
MdTable = Me.strtable & "MissingData"
DoCmd.CopyObject , MdTable, acTable, "MissingData"
'Run the SQL steps in order
DoCmd.RunSQL strSQL
DoCmd.RunSQL strSQL1
DoCmd.RunSQL strSQL2
|