I'm running a simple code to set several fields to "". The fields are sequentially numbered so I created a loop to run through them. I get a type mismatched at 8 on the first list and 10 on the second list. If it didn't work at all I would understand, but why it makes it so far then stops. I don't know. I set first list to stop at 7, and then discovered the second list would stop with the same error at 10. All of the fields are identically set up as Text 255 characters long. I can't see any difference between ERMB7 and ERMB8 or MB9 and MB10, no matter what I look at. Perhaps you guys can give me some direction where to look.
Private Sub Command1171_Click()
Dim badgefield As String
Dim ctrl As Control
Dim counter As Integer
'Erase Previous Entries
counter = 1
Do While counter <= 16
badgefield = "ERMB" & counter
Set ctrl = Me.Controls(badgefield)
ctrl = ""
counter = counter + 1
Loop
counter = 1
Do While counter <= 24
badgefield = "MB" & counter
Set ctrl = Me.Controls(badgefield)
ctrl = ""
counter = counter + 1
Loop