Here's the subroutine I try to use, it doesn't work.
Code:
Private Sub Command40_Click()
Dim db As Object
Dim db1 As Object
Dim db2 As Object
Dim db3 As Object
Set dbVideoCollection = CurrentDb
Set db1 = dbVideoCollection.OpenRecordset("numbers")
Set db3 = db1.Fields
' Scan the records from beginning to each
While Not db1.EOF
'
For Each db2 In db1.Fields
' then change its value
db1.Edit
db1("GradeID").Value = Val(db1.[GradeID].Value)
'[GradeID].NumberFormat = "general"
db1.Update
Next
' Move to the next record and continue the same approach
db1.MoveNext
Wend
stDocName = "Report"
DoCmd.OpenReport stDocName, acPreview
End Sub
says "Invalid use of Null"
I have a query which uses GETCSWord to break up the CSV file.
Step 1: CSV file comes from machine
Step 2: Access opens CSV file and uses VBA to open a session of Excel to save it into generic 2003 XLS file which Access can understand
Step 3: Access opens this file as a linked file, and the above VBA code is applied to multiple columns in order to reduce the decimal count to two where necessary.
Alternatively, simply importing the XLS file and telling the import wizard that a column is integers, such as GRADE ID, blanks out the entire column on import.
(example)DMS-CCRL,I121000068,Drawing Number,mk-50-PA2039,description,shawntestflange,,,303,0,304,0,, ,,,,,,,,,ND,,ND,, 18.38, 0.20, 1.71, 0.10, 70.86, 0.45,ND,, 8.35, 0.19, 0.4040, 0.0497,ND,,ND,,ND,, 0.2893,(/example)
Grade ID in the above line is 303.