473,394 Members | 1,726 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,394 software developers and data experts.

How to return a value if results equal a number?

17
i am new to the VBA world.

I am using a option group to give the user checkboxes.

1 = Blue
2 = Red
3 = Black
4 = Green

However using the option group it only stores the values as numbers.
I am creating a report, i cannot place the optikon group on the report because the user wants to see it as a word not a checkbox.
So i am trying to place on the report, if value =1 display the word "Blue", but i don't know how to do.

Please help!
Jan 23 '08 #1
2 1492
missinglinq
3,532 Expert 2GB
One way would be to not bind the Option Group to the field in the underlying table, but to assign a value to the field depending on which checkbox is selected. In the example I called the field in the table Hue. Replace its name and the name of the frame holding your Option Group with your own actual names:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourFrameName_Click()
  2.  
  3. Select Case YourFrameName
  4.  
  5. Case 1
  6. Me.Hue = "Blue"
  7.  
  8. Case 2
  9. Me.Hue = "Red"
  10.  
  11. Case 3
  12. Me.Hue = "Black"
  13.  
  14. Case 
  15.  Me.Hue = "Green"
  16.  
  17. End Select
  18. End Sub
Welcome to TheScripts!

Linq ;0)>
Jan 23 '08 #2
ckrows
17
Thanks Linq, it worked like a charm, this is my new standard now.
Jan 29 '08 #3

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

Similar topics

47
by: Martin DeMello | last post by:
It seems to be a fairly common pattern for an object-modifying method to return None - however, this is often quite inconvenient. For instance def f(lst1, lst2): g((lst1 + lst2).reverse()) #...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
8
by: Gompie | last post by:
Why does the function DMin("Abs(!- #" & & "#)";"SomeTable") not work properly with datefields. It always finds the closest difference with a later date only, if an earlier date in the table is...
7
by: hugo27 | last post by:
obrhy8 June 18, 2004 Most compilers define EOF as -1. I'm just putting my toes in the water with a student's model named Miracle C. The ..h documentation of this compiler does state that when...
11
by: randomtalk | last post by:
hi, i have the following recursive function (simplified to demonstrate the problem): >>> def reTest(bool): .... result = .... if not bool: .... reTest(True) .... else: .... print...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
13
by: Jim in Arizona | last post by:
I made a page with a gridview that has rows show a different color if a number in a column is greater than or equal to 45. I also did this conditional formatting for the column next to it. Here's...
2
by: mosesdinakaran | last post by:
Hi everybody, Today I faced a problem where I am very confused and I could not solve it and I am posting here.... My question is Is is possible to return a value to a particular function ...
17
by: pbd22 | last post by:
Hi. How does one return a range of rows. I know that "Top 5" will return rows 0 - 5 but, how do I get 6 - 10? thanks
21
by: google.bo | last post by:
I don't remember the exact syntax, however I've heard that return a==b; is valid c (like in gcc does not complain) my questions: 1) is this real C standard? 2) as there is no true nor false in C...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.