Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option buttons

Status
Not open for further replies.

teebird

Technical User
Dec 11, 2001
239
0
0
Hi Everyone

I have 3 option buttons on a form that when the user selects 1, 2 or 3, 2 textboxes will be disabled. Here is my code but I am stuck.

Private Sub fraReport_BeforeUpdate(Cancel As Integer)
Dim i As Integer

Const conMyValue = 1

For i = 1 > 3

If Me!fraReport.Value = conMyValue Then

Me!BeginningDate.Enabled = False

Me!EndingDate.Enabled = False

Else

Me!BeginningDate.Enabled = True

Me!EndingDate.Enabled = True

End If
Next i
End Sub

It will only grey out on the 1st option button. Any help would be great.

Thanks tee


 
What is the loop for?

Try this:

Private Sub fraReport_AfterUpdate()

If Me!fraReport.Value = 1 Then
Me!BeginningDate.Enabled = False
Me!EndingDate.Enabled = False
Else
Me!BeginningDate.Enabled = True
Me!EndingDate.Enabled = True
End If

End Sub

Hope that helps.


Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top