Jim Dudley
Registered User.
- Local time
- Today, 09:13
- Joined
- Feb 16, 2012
- Messages
- 81
The code we use was created by a Contract Programmer. This section of the code is to post the File Name, date & time, number of records imported to the table.
The Name and number of records post correctly but the time post only as time no date and the time is wrong.
The format for the [Date/Time] field is 'Short Date', mm/dd/yy.
Windows 7 date setting is the same. Our Db is Access 2010.
My skill level is 0. This will be my first attempt at modify/editing VBCode.
Please be patient.
2 things:
Is there something wrong with the Code?
What would have to be added to the code to have the 'tbl_ImportHistory' display at the end of the Import Process?
Code:
'Append to the import history. Added 1/2/2012
strFileAdd = Mid(strcurfrm, 12, Len(strcurfrm) - 11)
intTotalCount = DCount("*", strImportTable)
CurrentDb.Execute "INSERT INTO tbl_Import_History ( ih_File_Name, ih_Import_Date, ih_Total_Records ) " & _
"VALUES (""" & strFileAdd & """, " & Date & ", " & intTotalCount & ")"
114 intImportCount = intImportCount + 1
115 Next x
intRetVal = CheckForNew(strImportTable, strDBTable, strImportHoldingTable)
Thank you.
Jim Dudley
The Name and number of records post correctly but the time post only as time no date and the time is wrong.
The format for the [Date/Time] field is 'Short Date', mm/dd/yy.
Windows 7 date setting is the same. Our Db is Access 2010.
My skill level is 0. This will be my first attempt at modify/editing VBCode.
Please be patient.
2 things:
Is there something wrong with the Code?
What would have to be added to the code to have the 'tbl_ImportHistory' display at the end of the Import Process?
Code:
'Append to the import history. Added 1/2/2012
strFileAdd = Mid(strcurfrm, 12, Len(strcurfrm) - 11)
intTotalCount = DCount("*", strImportTable)
CurrentDb.Execute "INSERT INTO tbl_Import_History ( ih_File_Name, ih_Import_Date, ih_Total_Records ) " & _
"VALUES (""" & strFileAdd & """, " & Date & ", " & intTotalCount & ")"
114 intImportCount = intImportCount + 1
115 Next x
intRetVal = CheckForNew(strImportTable, strDBTable, strImportHoldingTable)
Thank you.
Jim Dudley