Radio button and options value from table or query

DevAccess

Registered User.
Local time
Today, 01:29
Joined
Jun 27, 2016
Messages
321
Hello there

I am creating ms access 2016 desktop application, in that i would like to add radio button which needs to have value from table, I know about option group but it asks for hard coding the value in the wizard which i don't want.

I would to have radio button option dynamically from table or query.

Thanks
MAN
 
Maybe some more info on what you want to do is needed but generally an option group has a numerical value for each option. To dynamically assign a value you can use a select case statement based on the option group value.

Code:
select case me.MyOptionGroup

case 1

MyVariable = ...

case 2

MyVariable = ...

end select

you can also change the OptionValue property of a radio button in an option group with code
Code:
Me.Option5.OptionValue = 55
 
Last edited:
thanks but I need to have option value of radio button filled dynamically, I think provided the code for the changing value of the other field based on radio button option selection
 
I've read your posts three times and, like moke123, I have no idea what you're trying to accomplish! A much better explanation, in plain language, is needed in order for us to help you.

Linq ;0)>
 
Me confused too :)

How are you going to determine what value you assign to what option group?

If you are going to look this up in a table based on another field you may as well just have a command button and change it's function in code based on the lookup...
 
I want radio box value to be populated from table.

Like

Radio buttons for each below value.

Open
Closed
In Progress

Tomorrow if I changed this values in the table, it should automatically change the options of radio button as well.

Thanks
MAN
 
Well that's a simple DLookup on form load, and you could change the option group returned number as well.

But what that won't do is change which code fires behind that option group. You'll still have to write code to cater for every possible option return value.
 

Users who are viewing this thread

Back
Top Bottom