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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option (Radio button) code not working on record change

Status
Not open for further replies.

ragu111

MIS
Aug 15, 2002
129
AE
i'm using below code on my form for the Option (radio button):

Code:
Private Sub Option61_GotFocus()
Me.txtDuty.Visible = True
End Sub
Code:
Private Sub Option57_GotFocus()
Me.txtDuty.Visible = False
End Sub

it's working well when i enter a new record. but when i tried to move between records it's not working. can someone help on this

Ragu [pc]

 
How are these options set up? Are they each bound to a different field or are they part of an Option Group? The usual way to set controls when moving from record to record, is to use the On Current event, but how you do this will depend on the option set up.

Also, why Got Focus? I do not see an If ... True or any other test for the value of the option.

Why not:
[tt]Me.txtDuty.Visible = Me.Option61[/tt]
Or something similar?


 
these option are under one group...

how to make it on current event??

 
You still do not say whether they are bounfd to a field. Let us say that they are. You could say something like:

Code:
Private Sub Form_Current()
If Me.[i][Insert Option Group Name][/i] = 1 Then
   Me.txtDuty.Visible = True
Else
   Me.txtDuty.Visible = False
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top