Option Group

John M

Registered User.
Local time
Today, 18:46
Joined
Nov 20, 2001
Messages
69
Scenario:
Book type is bounded field with choice of "Hire" or "Sell". I can set up an option group but it would mean that I will store 1 or 2 respectively in the underlying table. Can option group be programmed to store other values besides numbers.
 
From Access Help:

"The OptionValue or Value property is set to a number because the value of an option group can only be a number, not text."
 
Hi David R,

This might sound dumb but I can't get it to work. Here is my situation that I tried.

I have "table1" with "field1" of text type. On the form (bounded to table1) I have created an option group "frame1" with labels "buy" and "sell". In the frame control I set control source =Choose([field1], "buy", "sell"). The message I get is that the control cannot be edited. Please tell me what I doing wrong here. Your help is really really appreciated.
Thanks
 
Or, if you want to enter "Hire" when Option 1 is selected and "Sell" when Option 2 is selected do this:

Place a text box with Visible set to NO on your form. Bind that text box to the field where you want the text "Hire" or "sell" to show up.

In the ON CLICK of the option box place this code (optMyOptions is the name of your option group, txtMyHiddenTextBox is whatever name you give your hidden text box):

Select Case optMyOptions
Case 1
txtMyHiddenTextBox.Value = "Hire"
Case 2
txtMyHiddenTextBox.Value = "Sell"
End Select

I use that method quite frequently.

BL
hth

[This message has been edited by boblarson (edited 12-26-2001).]
 
Pat,

I got you. What you are saying is that in the table level it is still an integer but you use the Choose() function to translate the full key.

Thanks
 
Very helpful post, thank you.. I will use this alot..

Although in my case this option doesn't work.. I have an option group with 2 options: Dutch and English. When I select Dutch I should see a dutch letter to the customer in my text box, when I select English it should display the english translation.. I should also be able to store the letters in the table my form is bound to..

I searched the forum to find an answer but couldn't find any.. My apologies if this question has been asked before
 

Users who are viewing this thread

Back
Top Bottom