Option Box (option values from numeric to text)

R

Rob M.

Hi! I'm new at this vb programming and haven't written a code yet, read alot,
but no action. Anyways, I used a wizard to set up an Option Frame; I wanted
to know if I can store the option value from a number into a text box
[AcctType] i.e "asset".

Can I use a Select Case Statement? Would it be a function? Would the Option
Frame get the focus or the text box?

I'm sorry, I just had to submit my first question as green as I am.

Thank you so much!

Rob
 
F

fredg

Hi! I'm new at this vb programming and haven't written a code yet, read alot,
but no action. Anyways, I used a wizard to set up an Option Frame; I wanted
to know if I can store the option value from a number into a text box
[AcctType] i.e "asset".

Can I use a Select Case Statement? Would it be a function? Would the Option
Frame get the focus or the text box?

I'm sorry, I just had to submit my first question as green as I am.

Thank you so much!

Rob

An option group only returns an Integer value 1,2,3, etc.
That's what you store in your table.

You can then show any text you wish, in a report, on a form, or in a
query.

Using an Unbound text control on a Form or in a Report...
A simple method, assuming there are just 3 option choices:
=IIf([OptionField] = 1, "Red",IIf([OptionField] = 2,"Green","Blue"))

A better way:
=Choose([OptionField],"Red","Green","Blue")

And yes, you can use a Select Case statement if you wish to write
code, but as you can see, it isn't necessary unless you have lot's of
choices.

In a query, it would be..
TextValue:Switch( etc...)
 
R

Rob M.

Thanks fredg, you really simplified this for me and I'm glad you understood
me. I really appreciate your help, sincerely, Rob
--
Rob M. Thanks for your help and If I helped I''''m glad to be of assistance.



fredg said:
Hi! I'm new at this vb programming and haven't written a code yet, read alot,
but no action. Anyways, I used a wizard to set up an Option Frame; I wanted
to know if I can store the option value from a number into a text box
[AcctType] i.e "asset".

Can I use a Select Case Statement? Would it be a function? Would the Option
Frame get the focus or the text box?

I'm sorry, I just had to submit my first question as green as I am.

Thank you so much!

Rob

An option group only returns an Integer value 1,2,3, etc.
That's what you store in your table.

You can then show any text you wish, in a report, on a form, or in a
query.

Using an Unbound text control on a Form or in a Report...
A simple method, assuming there are just 3 option choices:
=IIf([OptionField] = 1, "Red",IIf([OptionField] = 2,"Green","Blue"))

A better way:
=Choose([OptionField],"Red","Green","Blue")

And yes, you can use a Select Case statement if you wish to write
code, but as you can see, it isn't necessary unless you have lot's of
choices.

In a query, it would be..
TextValue:Switch( etc...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top