473,387 Members | 1,504 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.

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

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_AfterUpdate()
dim xy as integer
dim ab as string (i wanted to define this as text but i dont know how)

xy=frame38.value

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

End Select


Thank u very much for reading.
Jul 13 '07 #1

✓ answered by ADezii

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_AfterUpdate()
dim xy as integer
dim ab as string (i wanted to define this as text but i dont know how)

xy=frame38.value

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.

5 23542
ADezii
8,834 Expert 8TB
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_AfterUpdate()
dim xy as integer
dim ab as string (i wanted to define this as text but i dont know how)

xy=frame38.value

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
Thanks ADezii, that works very well. I followed exactly what u said "It works!!"

Thanks again.
Jul 13 '07 #3
ADezii
8,834 Expert 8TB
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 256MB
This worked for me too. Thank you ADezii!
Mar 27 '14 #5
ADezii
8,834 Expert 8TB
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
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...
1
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...
6
by: monikagovindaraj | last post by:
how to get the color pallete in single value from text box in php
1
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...
4
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...
5
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...
2
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...
11
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: ...
1
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...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.