I was trying something different with trying to change a date format within a text document by spliting a string. Here is the code I have. Does anyone see any stupid errors I'm making, or have any suggestions for a better way to go about the whole thing?
The line in blue bold is the line where I get the error..
Stephen![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
Code:
Private Sub FixDateFormat()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim X As Integer
Dim strDate As String
Dim varDate1(2) As Variant
Set db = CurrentDb
Set rs = db.OpenRecordset("tblTest")
rs.MoveFirst
X = 1
Do While Not rs.EOF
strDate = rs.Fields("TransDate")
varDate1(1) = Split(strDate, 2)
rs.Edit
[b][blue]rs.Fields("NewTransDate") = varDate1(1)[/blue][/b]
rs.Update
rs.MoveNext
X = X + 1
Loop
MsgBox X & "Records Updated"
End Sub
Stephen
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV