473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting a Value from an Option Group

I created a group of option buttons using the wizard. Now I want to decide which action to take based on which option was selected, I can't seem to find the syntax testing which button is selected. I thought maybe something like:
"IF [Forms]![Form Name]![Option Button Name]=1 THEN..."
would work, but it says I entered an expression that has no value.
Sep 20 '07 #1
3 26051
ADezii
8,834 Expert 8TB
I created a group of option buttons using the wizard. Now I want to decide which action to take based on which option was selected, I can't seem to find the syntax testing which button is selected. I thought maybe something like:
"IF [Forms]![Form Name]![Option Button Name]=1 THEN..."
would work, but it says I entered an expression that has no value.
Assuming your Option Group Name is optTest, and you went with the Default Values (1 to 6) for each Option:
Expand|Select|Wrap|Line Numbers
  1. Select Case Me![optTest]
  2.   Case 1
  3.     MsgBox "You chose Option 1"
  4.   Case 2
  5.     MsgBox "You chose Option 2"
  6.   Case 3
  7.     MsgBox "You chose Option 3"
  8.   Case 4
  9.     MsgBox "You chose Option 4"
  10.   Case 5
  11.     MsgBox "You chose Option 5"
  12.   Case 6
  13.     MsgBox "You chose Option 6"
  14. End Select
Sep 21 '07 #2
Assuming your Option Group Name is optTest, and you went with the Default Values (1 to 6) for each Option:
Expand|Select|Wrap|Line Numbers
  1. Select Case Me![optTest]
  2.   Case 1
  3.     MsgBox "You chose Option 1"
  4.   Case 2
  5.     MsgBox "You chose Option 2"
  6.   Case 3
  7.     MsgBox "You chose Option 3"
  8.   Case 4
  9.     MsgBox "You chose Option 4"
  10.   Case 5
  11.     MsgBox "You chose Option 5"
  12.   Case 6
  13.     MsgBox "You chose Option 6"
  14. End Select


Yep, that does the trick. Thanks.
Sep 21 '07 #3
ADezii
8,834 Expert 8TB
Yep, that does the trick. Thanks.
You are quite welcome.
Sep 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Lisa | last post by:
I know this is supposed to be easy but I can't get this to work. I have a dropdown that pulls all the Projects (tp_title) available. All I want to do is get the ID (tp_id) of that record so I can...
1
by: Rage Matrix | last post by:
Hi all, I have a small problem with Access radio button groups in VBA. I've got a radio button group called fraSearchMode with three radio buttons in it. At a certain point, I want to see which...
1
by: annbb | last post by:
I have a piece of code which resets all the control on a form ..but if I also put an option group on the form and the relevant code in the routine to reset it I get an error message saying that...
3
by: amit | last post by:
Hello group, I have switched to linux and PHP so totally new to this field. Please help me with my question. I have an HTML code which contains a drop-down control on it using <select...
8
by: Raul | last post by:
Hi, I have a select list that gets populated from the DB. When the user makes a selection I am able to retrieve this value via Request.Form(...) However, I am wondering if you can retrieve...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
4
by: JHite | last post by:
I am using Access 2003 on Windows XP. This is a simple database that contains “tblStaffers” containing names of the office staffers, “tblProjects” containing names of the office projects, and...
9
vikas251074
by: vikas251074 | last post by:
I am not getting date value in spite of my good effort. This code was working in my last office where I work. Now I am trying to work at my home pc. but not getting date value. Any can help me why...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.