473,666 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change Option Group value (from # to text)

6 New Member
Help me out please...

Ok, i have been trying to do this for months….I kinda gave up on it but am back at it again.

I created a form for a table (Bills). In the form, I have three option buttons (Yes,Tbd,No). The problem is that the value of these options are numbers (1,2,3). Therefore, every time I add a record using the form I end up with numbers on the column (A_Approved). So basically now I have to go to the table & change the numbers into (yes,tbd,no) manually!! It Sucks. Cause I know there has to be some kind of way.

Some one told me that I should use 'Select Case' and the following is what I came up with (totally not working), U can ignore if it doesn’t make sense.


Private Sub Frame38_AfterUp date()
dim xy as integer
dim ab as string (i wanted to define this as text but i dont know how)

xy=frame38.valu e

Select Case Me!Frame38
Case 1:
xy="YES"
Case 2:
xy="TBD"
............

End Select


Thank u very much for reading.
Jul 13 '07 #1
5 23619
ADezii
8,834 Recognized Expert Expert
Help me out please...

Ok, i have been trying to do this for months….I kinda gave up on it but am back at it again.

I created a form for a table (Bills). In the form, I have three option buttons (Yes,Tbd,No). The problem is that the value of these options are numbers (1,2,3). Therefore, every time I add a record using the form I end up with numbers on the column (A_Approved). So basically now I have to go to the table & change the numbers into (yes,tbd,no) manually!! It Sucks. Cause I know there has to be some kind of way.

Some one told me that I should use 'Select Case' and the following is what I came up with (totally not working), U can ignore if it doesn’t make sense.


Private Sub Frame38_AfterUp date()
dim xy as integer
dim ab as string (i wanted to define this as text but i dont know how)

xy=frame38.valu e

Select Case Me!Frame38
Case 1:
xy="YES"
Case 2:
xy="TBD"
............

End Select


Thank u very much for reading.
  1. Make sure your Option Group is Unbound.
  2. Create a Text Box on your Form and Name it txtValues.
  3. Set the Control Source of this Field to the Field in the underlying Table that will store the values of YES, TBD, and NO.
  4. Set the Visible Property of txtValues to No.
  5. Copy and Paste the following code to the AfterUpdate() Event of the Option Group Frame.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Frame38_AfterUpdate()
    2. Select Case Me![Frame38]
    3.   Case 1
    4.     Me![txtValues] = "YES"
    5.   Case 2
    6.     Me![txtValues] = "TBD"
    7.   Case 3
    8.     Me![txtValues] = "NO"
    9. End Select
    10. End Sub
  6. When you click on an Option in the Frame, the appropriate Text will be written to txtValues and stored in the Database as Text.
  7. This process will be completely Transparent to the User, since the Text Box is invisible.
  8. Let me know how you make out.
Jul 13 '07 #2
Student1000
6 New Member
Thanks ADezii, that works very well. I followed exactly what u said "It works!!"

Thanks again.
Jul 13 '07 #3
ADezii
8,834 Recognized Expert Expert
Thanks ADezii, that works very well. I followed exactly what u said "It works!!"

Thanks again.
You are quite welcome.
Jul 13 '07 #4
DanicaDear
269 Contributor
This worked for me too. Thank you ADezii!
Mar 27 '14 #5
ADezii
8,834 Recognized Expert Expert
You are quite welcome, DanicaDear.
Mar 28 '14 #6

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

Similar topics

2
1584
by: Ian Eagland | last post by:
Hi I am just starting on Visual C (2003) from a VB background. I find it easier to learn by actually programming. I have fallen over at the first hurdle. How do you extract a numerical value from a text box? I have a number of reference books but it is not mentioned because I guess it is simple and I am just missing it. Regards
1
1872
by: Jerry John | last post by:
I am working in ASP.NET with C#. I have a text file which contains datas with delimiters. For example:- MSH|^~\$|DISCHARGE|CLAY COUNTY MEMORIAL|||200502110939| I also have an XML file created with predefined tags. Some of the tags contain child element. I need to pass the data from the text file i.e the value within the delimiters should be passed to the corresponding tags within the XML file. I have done this through hard code. But i...
6
1494
by: monikagovindaraj | last post by:
how to get the color pallete in single value from text box in php
1
1151
by: AnDiKa | last post by:
Dim DatTim1 As Date = #12/1/2007# Dim DatTim2 As Date = #12/1/2007# Dim WD As Long = DateDiff(DateInterval.Day, DatTim1, DatTim2) Me.totalCount.Text = WD + 1 I used the code above to calculate date interval between two date. but, i dont want to declare DatTim1 & DatTim2 as a constants value. Because i want the user to key in the values in the text box. how can i declare the value from the text box to the DatTim1 & DatTim2?
4
3224
by: mandarchalke29 | last post by:
Can anyone please tell me how do set the javascript variable value to a simple text file and to retrieve the same value using PHP. Means to set the value in text file using javascript and to get the value from that text file using PHP.
5
2410
by: dmorand | last post by:
Ok, I'm very new to asp, but this is what I'm trying to accomplish. I want to have a selection drop down list where the user can select a database to load. When they select the database, I want that value to then populate the asp variable named "database". I was hoping I could pass this using javascript, but I don't think I can because asp is server side and javascript is client side. Any help would be appreciated! <!DOCTYPE HTML...
2
4652
by: mndprasad | last post by:
Hi friends, Am new to AJAX coding, In my program am going to have two texbox which going to implent AJAX from same table. One box is going to retrieve the value of other and vice versa. I have implemented successfully for one text box, but it's done for the other field, since am getting script errors. <script> var queryField; var lookupURL; var divName;
11
5281
tuxalot
by: tuxalot | last post by:
Another quick question for ya... Here's my button code, and I want to see if I can do something different so I don't have to repeat the same code for each of my 14 buttons in my option group: Private Sub grpS1_LostFocus() Dim intCount As Integer Dim lngRed As Long, lngBlack As Long lngRed = RGB(186, 20, 25)
1
3842
by: wayne smith | last post by:
Hi, I am building a inventory system using ms access. Each inventory id can be from different regions. In one form, users enter the inventory id and if there is more than one region, another form opens up to let the users choose the region. I am thinking of using an option group to display all the regions that is associated with that inventory id. Is there any way i can programmatically assign the number of radio buttons and their labels name...
0
8444
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.