ed coleman
Registered User.
- Local time
- Today, 02:47
- Joined
- Nov 8, 2012
- Messages
- 44
I have a table where there are various size measurements in one textbox. They are delimited with an x and I have managed to find code to split them into columns on the form and, hence, the table itself. My problem is that I cannot get VBA code to loop and perform the same operation on each record.
The code works on the first record and if I put my cursor in a blank cell for the next record and hit the command button, it will populate that record, but will not loop through the record set.
Any assistance with my problem is appreciated.
The code that I am currently using is below as well as the form that I have attached.
The code works on the first record and if I put my cursor in a blank cell for the next record and hit the command button, it will populate that record, but will not loop through the record set.
Any assistance with my problem is appreciated.
The code that I am currently using is below as well as the form that I have attached.
Code:
Private Sub Command39_Click()
Dim v As Variant
Dim sOne As Variant
Dim i As Integer
Dim rs As DAO.Recordset
Set rs = DBEngine(0)(0).OpenRecordset("tblforsplit")
Do While Not rs.EOF
'for width only
v = Split(Me.WIDTH_SCORE, " x ")
i = 0
For Each sOne In v
i = i + 1
Me("w" & i) = sOne
Next
rs.MoveNext
Loop
Refresh
rs.Close
End Sub
Last edited: