option value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I designed a form and using option button control. I can enter values of 1,
2, 3 etc. What I want is to enter values of 0.007, 0.015 and 1.5. Access does
not let me do it. Any help will be greatly apreciated. Total Newbie.
 
In such cases, you need to write some code behind the option button.

Private Sub optMyOptionButton_Click()
If Me.optMyOptionButton = True Then
sngSomeValue = 0.007
End If
End Sub

Private Sub optMyOtherOptionButton_Click()
If Me.optMyOtherOptionButton = True Then
sngSomeValue = 1.5
End If
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
 
An alternative to Graham's excellent suggestion, is to set up a simple
table, 2 fields and 3 records, where you record the Option Values of the
Option Buttons in the Option Group, i.e. 1, 2, 3, and the corresponding
values you want to return, i.e. 0.007, 0.015, and 1.5. Then you simply
include this table in the query behind any form or report or calculation
where you need the 0.007, 0.015, 1.5 values.
 
Back
Top