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 Group Frustrations

Status
Not open for further replies.

taysys

Programmer
Dec 7, 2001
41
US
I have been fighting using option group/buttons for too long, so maybe someone can assist me.

I am using VFP6 (latest SP) & Codemine 6.1.21.

I have a &quot;status&quot; field in a DB that is either &quot;A&quot; for active or &quot;T&quot; for terminated. In my option group on a pageframe page, I have two buttons &quot;Active&quot; and &quot;Terminated.&quot; I have set the Controlsource on the group to <alias>.status field.

I was assuming that if the status in the retrieved record was equal to &quot;A&quot; then the optActive button value = 1 and optTerm value = 0 and visa versa for status equalling &quot;T.&quot; I also set the value of the option group opgStatus to either &quot;0&quot; for &quot;active&quot; or &quot;1&quot; for terminated.

Anyway, no buttons are getting set as I click on them and they do not go true (or are getting reset somewhere else). Since the buttons aren't getting a value then the field is not getting updated.

So what do you think.... all suggestions are welcome. TIA!

Bob Taylor
 
To get it to automatically tie into the table field, you have to make the caption of each option button EXACTLY the same as the field contents. There are a few options for you.

The simplest would be to expand the STATUS field to 10 characters and use the full string &quot;Active&quot; or &quot;Terminated&quot;. Then your option group would work properly.

Another option would be to change the captions on the buttons to just &quot;A&quot; and &quot;T&quot;, perhaps adding an external label next to them that read &quot;ctive&quot; and &quot;erminated&quot; to give the illusion of them being part of the captions.

The third option would be to make Status NUMERIC instead, and use the values 0 and 1 to correspond to the option group. This will simply work, as well, since the OptionGroup value can be numeric OR character depending on the field it is bound to.
 
Thanks for the reply! This may be one of my disadvantages where I work with three different languages and they handle option buttons. Before, your rply, I had done some tracing and saw that the option group was returning the caption of the button. So your suggestion of either redefining the field or the option button is well received.

Thanks for your assistance!

Bob Taylor
 
If you are going to localize the program, then I HIGHLY suggest you go with the numeric field instead of character. The labels will change; the numbers will not.
 
This is currently a Novel 4.11 network multi-user app. It habeen work fine until I made these requested mods. I do have it working now, though I implemented your suggestion of using the first letter (A ot T) with labels to completed the option selection.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top