Problem with Option Buttons

  • Thread starter Thread starter jdm
  • Start date Start date
J

jdm

I have option buttons that link to pages within the form
and others that link to fields on a particular page. When
an option button for the first record is selected, that
option/page is selected for all of the subsequent records.

This is the coding I have surrounding the form

Private Sub Form_Load()
SetEnable
End Sub

This is an example of coding under Sub SetEnable() for an
option button that selects a page

If [RFV OPTION].Value = -1 Then
RFV.Enabled = True
Else
RFV.Enabled = False
End If

What am I doing wrong?
 
I have option buttons that link to pages within the form
and others that link to fields on a particular page. When
an option button for the first record is selected, that
option/page is selected for all of the subsequent records.

This is the coding I have surrounding the form

Private Sub Form_Load()
SetEnable
End Sub

This is an example of coding under Sub SetEnable() for an
option button that selects a page

If [RFV OPTION].Value = -1 Then
RFV.Enabled = True
Else
RFV.Enabled = False
End If

What am I doing wrong?

You haven't said what difficulty you are having, so here is a guess.

Are you using an Option Group or a Check Box.
A Check Box has a value of either -1 or 0.

If it is a Check Box, then use:

RFV.Enabled = [RFV Option]

If it is an Option Group, the Group has a number value of 1, 2, 3, ...
etc.
You can use:

RFV.Enabled = [RFV Option] = 1
 
The problem is really that when I select the option, it is
should only be related to one record, but it isn't. It
becomes true for all records.

For example (of how I want it to work):

Record 1 RFV Option is selected - the RVF page/tab is
available (not grayed out)

Record 2 RFV Option is not selected - the RFV page tab is
not available (grayed out)

-----Original Message-----
I have option buttons that link to pages within the form
and others that link to fields on a particular page. When
an option button for the first record is selected, that
option/page is selected for all of the subsequent records.

This is the coding I have surrounding the form

Private Sub Form_Load()
SetEnable
End Sub

This is an example of coding under Sub SetEnable() for an
option button that selects a page

If [RFV OPTION].Value = -1 Then
RFV.Enabled = True
Else
RFV.Enabled = False
End If

What am I doing wrong?

You haven't said what difficulty you are having, so here is a guess.

Are you using an Option Group or a Check Box.
A Check Box has a value of either -1 or 0.

If it is a Check Box, then use:

RFV.Enabled = [RFV Option]

If it is an Option Group, the Group has a number value of 1, 2, 3, ...
etc.
You can use:

RFV.Enabled = [RFV Option] = 1

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
The problem is really that when I select the option, it is
should only be related to one record, but it isn't. It
becomes true for all records.

For example (of how I want it to work):

Record 1 RFV Option is selected - the RVF page/tab is
available (not grayed out)

Record 2 RFV Option is not selected - the RFV page tab is
not available (grayed out)
-----Original Message-----
I have option buttons that link to pages within the form
and others that link to fields on a particular page. When
an option button for the first record is selected, that
option/page is selected for all of the subsequent records.

This is the coding I have surrounding the form

Private Sub Form_Load()
SetEnable
End Sub

This is an example of coding under Sub SetEnable() for an
option button that selects a page

If [RFV OPTION].Value = -1 Then
RFV.Enabled = True
Else
RFV.Enabled = False
End If

What am I doing wrong?

You haven't said what difficulty you are having, so here is a guess.

Are you using an Option Group or a Check Box.
A Check Box has a value of either -1 or 0.

If it is a Check Box, then use:

RFV.Enabled = [RFV Option]

If it is an Option Group, the Group has a number value of 1, 2, 3, ...
etc.
You can use:

RFV.Enabled = [RFV Option] = 1

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

I take it that the option is on the form, but is not bound to any
field in a table.

Code the Form's Current event:
Me![RFV Option] = ""
 
Back
Top