Option Group (possible to have text values?)

Choksy

Registered User.
Local time
Today, 21:13
Joined
Oct 28, 2001
Messages
48
I have designed an option group with two options

Singly
Jointly

But instead of number values, like 1 or 2 i want to have singly or jointly values so they can be transferred into table? Plz help or other solution?
 
Choksy, please find your duplicate threads and delete them and in the future, a single question will get you a far more responsive answer. Leave the stored value as a number. For display purposes in a report, either use the same option group that you used on your form or look up the choose() function. Choose() is a simple way of converting a small set of numeric values to text.
 
how to use choose?

please im new to this option group, how would i use the choose in my example
 
Re: how to use choose?

From Help:

Code:
Selects and returns a value from a list ofarguments.

Syntax

Choose(index, choice-1[, choice-2, ... [, choice-n]])

The Choose function syntax has these parts:

Part Description 
index Required.Numeric expression or field that results in a value between 1 and the number of available choices. 
choice Required.Variant expression containing one of the possible choices. 


Remarks

Choose returns a value from the list of choices based on the value of index. If index is 1, Choose returns the first choice in the list; if index is 2, it returns the second choice, and so on.

You can use Choose to look up a value in a list of possibilities. For example, if index evaluates to 3 and choice-1 = "one", choice-2 = "two", and choice-3 = "three", Choose returns "three". This capability is particularly useful if index represents the value in an option group.

Choose evaluates every choice in the list, even though it returns only one. For this reason, you should watch for undesirable side effects. For example, if you use the MsgBox function as part of anexpression in all the choices, a message box will be displayed for each choice as it is evaluated, even though Choose returns the value of only one of them.

The Choose function returns aNull if index is less than 1 or greater than the number of choices listed.

If index is not a whole number, it is rounded to the nearest whole number before being evaluated.

An Example:

Code:
Call ChooseFunc(1)

Public Function ChooseFunc(intI as Integer)
ChooseFunc  = Choose(intI, "Speedy", "United", "Federal")
end function

You seriously need to start using HELP, I can only imagine how bad your end users feel when users use your apps.

TRY TRY TRY
:eek:
 
i am using this code

SelectCase MyValue
Case is =1
MyAnswer ="Yes"
Case Is =2
MyAnswer = "No"
etc
End Select

is this right?
 
Re: i am using this code

Your table should store JUST the number 1 / 2 not the number and the string. Your FORM / Reports can display a string. For instance on a form in the control source you can do:

=Choose([YourField], "Subtly", "Jointly")

If your field [YourField] contains the value 1 it will display subtly, otherwise it will display jointly.
 
re

yes but its the same thing: i have put the following code:

SelectCase MyValue
Case Is = 1
My answer = "Singly"
Case Is = 2
My Answer = "jointly"
End Select

Not working and
 
Re: re

Choksy said:
yes but its the same thing: i have put the following code:

SelectCase MyValue
Case Is = 1
My answer = "Singly"
Case Is = 2
My Answer = "jointly"
End Select

Not working and

Then use what I just posted...
 
Re: re

Choksy said:
yes but its the same thing: i have put the following code:

SelectCase MyValue
Case Is = 1
My answer = "Singly"
Case Is = 2
My Answer = "jointly"
End Select

Not working and

Debug it ...

what does MyValue contain? Why does your variable have a space in it. Backus Naur Form my son.

A Variable is defined as:

V-> {A-Z | '_' | {A-Z | 0-9 | '_'}}

A variable begins with a letter or an underscore and is followed by any number of letters, digits, and underscores.
 
no good

Well the information needs to be stored in Excel and displayed as SINGLY OR JOINTLY?*
 
Choksy said:
I have designed an option group with two options

Singly
Jointly

But instead of number values, like 1 or 2 i want to have singly or jointly values so they can be transferred into table? Plz help or other solution?

Where, oh where! was the mention of Excel in your original question?
 
ummm

Well i thought id let you know once im through with doing this. but your the professional so plz assist me. im trying reallly hard and not jus askin questions. n i have only two days for deadline§§:(:(
 
Re: ummm

Choksy said:
Well i thought id let you know once im through with doing this. but your the professional so plz assist me. im trying reallly hard and not jus askin questions. n i have only two days for deadline§§:(:(

Is this a report?

You need to seriously get your definition down...that is why we cannot help you. We too are trying but we're guessing because you're not providing a thorough explanation as to what you need.
You never said excel. Even if it is excel..my question is, is this a REPORT?

If so then you can still use the Choose function and export to excel will display the correct text.

I know you have deadlines, but you need to go to your boss and tell him / her you cannot do this stuff. Be honest with yourself...can you do this stuff? Maybe you need classes / practice...who knows...you're new and they are expecting functionality that involves some vb. I suggest you tell them straight up, "I cannot do this stuff at this time". You'll feel better in the end.
 
  • Put a textbox on your form.
  • Bind it to the field you want.
  • Set the textbox's visible property to No.
  • On the AfterUpdate event of the option group's frame (the frame, not any component of the group) put the code below, changing the object names, of course, to suit:


Code:
Me.txtTextbox = Choose(Me.fraOptionFrame, "Singly", "Jointly")
 
RE

I have explained my system in one page.. remrbr ystday..plzz i cant quit now cos i have to do it and i wanna try..plz read abt my system.. this is what i need

OPTION GROUP

SINGLY
SELECTS ONE------ TEXT ENTERED INTO THE
DESCRIPTION TABLE. Jointly and
Singly are taken from a table
authorisation, description
JOINTLY
 
Re: RE

I give up ... on all posts from this guy.

Im sorry chosky I just cannot bare the pain that Im going through just coming up with these nasty ideas to help you...
 
no luck

i tried that but no luck

What i have done:

in the form design, created a textbox then binded it to the option buttons setting visible no. Then in the option group button code, entreed the code with the correct frame reference but still no luck
 
java wat am i doin wrong?

well wat can i do? its not my fault shall i email u my form so its easier for you to undersand????
 

Users who are viewing this thread

Back
Top Bottom