A new wrinkle to the issue has arisen. Added an additional condition to the code and now the compile error is: Compile Error Loop without Do
Code:
Private Sub Command4_Click()
Dim mydb As DAO.Database
Dim myset As DAO.Recordset
Dim mycategory As String
Set mydb = CurrentDb
Set myset = mydb.OpenRecordset("Table1")
Do Until myset.EOF
myset.Edit
If myset!Coverage = "CCPLAT" Then
Select Case myset!Mileage
Case 0 To 24000
[mycategory] = "24,000"
Case 24001 To 36000
[mycategory] = "36,000"
Case 36001 To 50000
[mycategory] = "50,000"
Case 50001 To 60000
[mycategory] = "60,000"
Case Else
[mycategory] = "N/A"
End Select
Else
If myset!Coverage = "CCDIAM" Then
Select Case myset!Mileage
Case 0 To 50000
[mycategory] = "50,000"
Case 50001 To 75000
[mycategory] = "75,000"
Case 75001 To 100000
[mycategory] = "100,000"
Case 100001 To 125000
[mycategory] = "125,000"
Case 125001 To 150000
[mycategory] = "150,000"
Case Else
[mycategory] = "N/A"
End Select
End If
myset("Category").Value = mycategory
myset.Update
myset.MoveNext
Loop
End Sub
Not sure if this requires two do loops to work and if so, would it also require two edits and updates. I'm not sure of the correct syntax when using multiple loops.