TonyLackey
Registered User.
- Local time
- Today, 21:49
- Joined
- Oct 9, 2002
- Messages
- 19
I have this code:-
Function ChangeDate(adate As String) As String
Dim t As Integer
Dim num As String
Dim num2 As String
Dim zyear As String
Dim yyear As String
Set dbcurrent = currentdb()
num2 = Right(adate, 4) 'This is assigning the last 4 digits in the number to num2
zyear = 19
yyear = 20
For t = 0 To t = dbcurrent.Tabledefs("TableTest").RecordCount 'This line is counting each line in table1
If Left(adate, 7) < 1000000 Then 'If date is less than jan 01 2000 then 19 is appended to the front
adate = zyear & Left(adate, 2) & num2
Else
adate = yyear & Mid(adate, 2, 2) & num2 ' Otherwise 20 is appended to front
End If
Next
ChangeDate = adate
End Function
Which is trying to update a field in an access table.
However when updating 10' of thousands of records it is slow, is there any way of making it faster.
cheers.
Function ChangeDate(adate As String) As String
Dim t As Integer
Dim num As String
Dim num2 As String
Dim zyear As String
Dim yyear As String
Set dbcurrent = currentdb()
num2 = Right(adate, 4) 'This is assigning the last 4 digits in the number to num2
zyear = 19
yyear = 20
For t = 0 To t = dbcurrent.Tabledefs("TableTest").RecordCount 'This line is counting each line in table1
If Left(adate, 7) < 1000000 Then 'If date is less than jan 01 2000 then 19 is appended to the front
adate = zyear & Left(adate, 2) & num2
Else
adate = yyear & Mid(adate, 2, 2) & num2 ' Otherwise 20 is appended to front
End If
Next
ChangeDate = adate
End Function
Which is trying to update a field in an access table.
However when updating 10' of thousands of records it is slow, is there any way of making it faster.
cheers.