S
Steven Scaife
Is it possible to change the value of a text box in a loop when it is a
datasheet.
I have some code that clones the forms recordset and loops through talking
part of a value in the table what i want to do is then write it to the text
box but it doesn't write it to the text box how i imagined. I know the code
for the loop is working cos i seen it in the debug window. However it
writes the last number from the recordset in every row. any ideas. thanks
in advance
Dim strDate As String
Dim RSt As Recordset
Dim RstCount As Integer
Dim i As Integer
Set RSt = Me.RecordsetClone
RSt.MoveFirst
RstCount = RSt.RecordCount
For i = 1 To RstCount
strDate = RSt("Contract ID")
strDate = Right(strDate, 4)
Debug.Print strDate
Me.txtOoD.Value = strDate
RSt.MoveNext
i = i + 1
Next
datasheet.
I have some code that clones the forms recordset and loops through talking
part of a value in the table what i want to do is then write it to the text
box but it doesn't write it to the text box how i imagined. I know the code
for the loop is working cos i seen it in the debug window. However it
writes the last number from the recordset in every row. any ideas. thanks
in advance
Dim strDate As String
Dim RSt As Recordset
Dim RstCount As Integer
Dim i As Integer
Set RSt = Me.RecordsetClone
RSt.MoveFirst
RstCount = RSt.RecordCount
For i = 1 To RstCount
strDate = RSt("Contract ID")
strDate = Right(strDate, 4)
Debug.Print strDate
Me.txtOoD.Value = strDate
RSt.MoveNext
i = i + 1
Next