View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Please Help: Whats wrong with my For loop?

With Me.StudentId.Value

Dim i As Integer

If Me.Name.Value = "" Then

For i = 1 To 3

MsgBox (" please re-enter Student Id number")

Exit For
Next i

Me.Name.Enabled = True
Me.Address.Enabled = True
Me.Ph_No.Enabled = True

End If

End with

I want the students to try inputing their ID 3 times before the Name,
Address and Ph_No fields are enabled for them to input.

Thanks in advance