A
accesskastle
Hi. I would like to create a loop to update some fields in a table. What
I'd like is update one field in a table based on another.
I want it to happen like this: the second letter in my string field
("YCode") goes up by one letter as my double numeric field ("YMAX") to steps
down by 10 at each increment. So if YMAX is 2343640, say YCode will be GK.
The next in the sequence would therefore be
YMAX=2346330
YCode=GL
the next
YMAX=2346320
YCode=GM
What I've got now is a clunker, that only updates about 1000 records at a
time, and I've got over 400,000 records to update:
Function YC(Ycoord As Double, GridCode As String) As String
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "UPDATE Grid10m SET Grid10m.YCode = '" & GridCode & "' WHERE
(((Grid10m.YMAX)=" & Ycoord & "));"
db.Execute strSQL, dbFailOnError
Debug.Print "Completed " & GridCode & ", " & Ycoord
End Function
Can anyone tell me how to have the VB go to the next letter in the alphabet
with the next increment?
AK
I'd like is update one field in a table based on another.
I want it to happen like this: the second letter in my string field
("YCode") goes up by one letter as my double numeric field ("YMAX") to steps
down by 10 at each increment. So if YMAX is 2343640, say YCode will be GK.
The next in the sequence would therefore be
YMAX=2346330
YCode=GL
the next
YMAX=2346320
YCode=GM
What I've got now is a clunker, that only updates about 1000 records at a
time, and I've got over 400,000 records to update:
Function YC(Ycoord As Double, GridCode As String) As String
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "UPDATE Grid10m SET Grid10m.YCode = '" & GridCode & "' WHERE
(((Grid10m.YMAX)=" & Ycoord & "));"
db.Execute strSQL, dbFailOnError
Debug.Print "Completed " & GridCode & ", " & Ycoord
End Function
Can anyone tell me how to have the VB go to the next letter in the alphabet
with the next increment?
AK