Advertisement
Advertisement
| 06.15.2008 at 02:09AM PDT, ID: 23485957 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: |
Function Import_PMKEYS_Proficiencies()
On Error GoTo ImportError_Err
'Imports Proficiencies data from PMKeyS Output Text File
Dim strFile As String
'Calculate PMKeyS data file path
varPMKeySFilePath = DLookup("ImportPMKeySPath", "systblSettings", "")
DoCmd.SetWarnings False
'Delete current data set
DoCmd.RunSQL "DELETE tblpmkProficiencies.* FROM tblpmkProficiencies;"
'Import new data set
strFile = Dir(varPMKeySFilePath & "prof*.txt", vbNormal)
Do While strFile <> ""
If strFile <> "." And strFile <> ".." Then
DoCmd.TransferText acImportDelim, "ImportSpec_PMKeyS_Proficiencies", "tblpmkProficiencies", varPMKeySFilePath & strFile, False, ""
End If
strFile = Dir()
Loop
'Delete ImportError tables if created
DeleteTable ("Prof_ImportErrors")
'Clean up unwanted records
DoCmd.RunSQL "DELETE tblpmkProficiencies From tblpmkProficiencies WHERE (((tblpmkProficiencies.[Unit Id]) Is Null));"
'Update PMKeyS Update Info
With Form_frmMenuMain
.ProfBy.Value = .varCurrentUser
.ProfUpdate.Value = Now()
End With
MsgBox "Data Transfer Complete"
ImportError_Exit:
DoCmd.SetWarnings True
Exit Function
ImportError_Err:
MsgBox Error$
Resume ImportError_Exit
End Function
|