D
Duane
Hello,
I am trying to update a field in my table. I want to concatenate the data
that is in the field, i.e. L-K with an incementing numbering system.
When the code is run the field ends up looking like the following:
L-K1
L-K2
L-K3
etc.
Ideally, I would like the update to look like this:
L-K01
L-K02
L-K03
L-K04
....
L-K10
L-K11
etc.
Here is my code.
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim x As Integer
Dim strEtching As String
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Open "SELECT * FROM tblTool"
x = 1
Do Until rst.EOF
strEtching = rst("Etching")
rst("Etching") = strEtching & x
rst.Update
x = x + 1
rst.MoveNext
Loop
rst.Close
Thanks in advance
I am trying to update a field in my table. I want to concatenate the data
that is in the field, i.e. L-K with an incementing numbering system.
When the code is run the field ends up looking like the following:
L-K1
L-K2
L-K3
etc.
Ideally, I would like the update to look like this:
L-K01
L-K02
L-K03
L-K04
....
L-K10
L-K11
etc.
Here is my code.
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim x As Integer
Dim strEtching As String
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Open "SELECT * FROM tblTool"
x = 1
Do Until rst.EOF
strEtching = rst("Etching")
rst("Etching") = strEtching & x
rst.Update
x = x + 1
rst.MoveNext
Loop
rst.Close
Thanks in advance