Hello,
I am having a problem with a table where I want to delete the information in two rows of the table. What i have is an Excel file that im importing to a table. The current code im using deletes leading zeros from the first row that is imported which is what i need it to do, but at the very end of the report there are two additional rows that are being imported that I want to delete one is a date row another is a text row. I cant figure out how to adjust the code im using to delete these.
Any help would be great!
thanks so much
code im using
I am having a problem with a table where I want to delete the information in two rows of the table. What i have is an Excel file that im importing to a table. The current code im using deletes leading zeros from the first row that is imported which is what i need it to do, but at the very end of the report there are two additional rows that are being imported that I want to delete one is a date row another is a text row. I cant figure out how to adjust the code im using to delete these.
Any help would be great!
thanks so much
code im using
Code:
Public Function TrimZeroes()
Dim rec As DAO.Recordset
Dim lngLoop As Long
Dim lngCount As Long
Dim strData As String
Dim strTemp As String
Dim intStartRow As Integer
Set rec = CurrentDb.OpenRecordset("TableName")
rec.MoveLast
rec.MoveFirst
lngCount = rec.RecordCount
For lngLoop = 1 To lngCount
strData = rec("ColumnA")
strTemp = Left(strData, 1)
Do While strTemp = "0"
strData = Mid(strData, 2)
strTemp = Left(strData, 1)
Loop
rec.Edit
rec("ColumnA") = strData
rec.Update
rec.MoveNext
Next lngLoop
Set rec = Nothing
End Function
Comment