473,750 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert

I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared

Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.

Elaine

May 9 '07 #1
5 2308
Create a 2 column table with the number in one column and the text in the
2nd, Then use an update query to convert the number to text.

But, once you have the new table why convert? Use the table to provide
lookup on the forms, which will greatly improve you data consistency. Your
users would never need to see the number.

"Elainie" <El************ **@bsc.wales.nh s.ukwrote in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared

Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.

Elaine

May 9 '07 #2
On May 9, 2:38 pm, "paii, Ron" <p...@packairin c.comwrote:
Create a 2 column table with the number in one column and the text in the
2nd, Then use an update query to convert the number to text.

But, once you have the new table why convert? Use the table to provide
lookup on the forms, which will greatly improve you data consistency. Your
users would never need to see the number.

"Elainie" <Elaine.Macint. ..@bsc.wales.nh s.ukwrote in message

news:11******** **************@ h2g2000hsg.goog legroups.com...
I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared
Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.
Elaine- Hide quoted text -

- Show quoted text -
I have done that now and it works well, how do I edit it if I want to
add some more data?

Elaine

May 9 '07 #3

"Elainie" <El************ **@bsc.wales.nh s.ukwrote in message
news:11******** **************@ e51g2000hsg.goo glegroups.com.. .
On May 9, 2:38 pm, "paii, Ron" <p...@packairin c.comwrote:
Create a 2 column table with the number in one column and the text in
the
2nd, Then use an update query to convert the number to text.

But, once you have the new table why convert? Use the table to provide
lookup on the forms, which will greatly improve you data consistency.
Your
users would never need to see the number.

"Elainie" <Elaine.Macint. ..@bsc.wales.nh s.ukwrote in message

news:11******** **************@ h2g2000hsg.goog legroups.com...
I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared
Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.
Elaine- Hide quoted text -
- Show quoted text -

I have done that now and it works well, how do I edit it if I want to
add some more data?

Elaine
1) Provide a form to edit the lookup table.
2) If you want your users to add choices, look at the "Limit to list"
property and the "Not in List" event of the combo box.
May 9 '07 #4
The best way to do this is to store the number but display the text
translation by changing the default 'DisplayControl ' property of the
table field from 'TextBox' to ComboBox.

You can approach this in a couple of ways. The most flexible way is to
create a separate table that stores the code and translation and then
set the ComboBox.Record Source to use the new lookup table as the
source. The advantage with the lookup table is that should you ever
need to add a new value to the lookup list, you can do it by adding a
row to the lookup table rather than altering the table structure. It
also makes it easier to display the translations when writing queries
and reports. I'll leave that method as an exercise for you to do once
you're comfortable with using combo box lookups.

Since this is a simple list of options and it looks as if the choices
are unlikely to change, you can do a simple value list ComboBox:

1) Open the table containing your 'Status' field:

2) Select the 'Status' field.

3) In the Properties section at the bottom, click the 'Lookup' tab

4) Change the .DisplayControl from 'TextBox' to 'ComboBox'. A number
of additional properties for the combo box will be displayed.

5) Set the .RowSourceType to 'ValueList'. If you were to use the
external lookup table method, you would set the .RowSourceType to
'Table/Query' and set the .RowSource to point to your lookup table.
Since for this exercise we only need those particular values in our
list, set the .RowSourceType to 'ValueList'

6) Set the .RowSource to the list of values you want to be stored and
displayed separated by semicolons. The .ComboBox.Colum nCount property
controls how the list will be handled. In this example, we want to
store the code but display the translation. You will enter each row in
order: FirstOption.Cod e; FirstOption.Tra nslation; SecondOption.Co de;
SecondOption.Tr anslation; etc. If you wanted to display more columns,
just add those values in order and set the .ColumnCount property
appropriately.

Using your example, set the .RowSource to:

..RowSource = 1;Inactive;2;Du e;3;Received;4; Problems;5;Clea red

7) Set the .BoundColumn to 1. The bound column is the column to be
'bound' or stored in the base table. You can use any column as the
bound column if all columns are to be displayed in the .ComboBox
dropdown. In this example, we want to hide the 'Code' value, so
the .BoundColumn needs to be the first column in the list.

8) Set .ColumnCount = 2. We have 2 columns in our list.

9) Set .ColumnWidths = 0";1.5" . The display width of the Code
value is 0 so it will be hidden from display. The user will only see
the Translated value.

10) Set .ListWidth = 1.5" This controls how wide the entire dropdown
will be and it's annoying to have the displayed values cut off by the
default width.

11) Save your table.

Since you already have numeric values in the field, on opening the
table you will now see the Code Translation displayed. However, you
need to be aware that you are actually still storing the numeric value
when you pick from the dropdown list. This is important because if you
search that field for 'Inactive' you will get no hits - the stored
value is actually 1.

Good luck!

Ron, King of Chi

On May 9, 8:28 am, Elainie <Elaine.Macint. ..@bsc.wales.nh s.ukwrote:
I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared

Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.

Elaine

May 9 '07 #5

"King Ron" <Ki************ ***@covad.netwr ote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
The best way to do this is to store the number but display the text
translation by changing the default 'DisplayControl ' property of the
table field from 'TextBox' to ComboBox.

You can approach this in a couple of ways. The most flexible way is to
create a separate table that stores the code and translation and then
set the ComboBox.Record Source to use the new lookup table as the
source. The advantage with the lookup table is that should you ever
need to add a new value to the lookup list, you can do it by adding a
row to the lookup table rather than altering the table structure. It
also makes it easier to display the translations when writing queries
and reports. I'll leave that method as an exercise for you to do once
you're comfortable with using combo box lookups.

Since this is a simple list of options and it looks as if the choices
are unlikely to change, you can do a simple value list ComboBox:

1) Open the table containing your 'Status' field:

2) Select the 'Status' field.

3) In the Properties section at the bottom, click the 'Lookup' tab

4) Change the .DisplayControl from 'TextBox' to 'ComboBox'. A number
of additional properties for the combo box will be displayed.

5) Set the .RowSourceType to 'ValueList'. If you were to use the
external lookup table method, you would set the .RowSourceType to
'Table/Query' and set the .RowSource to point to your lookup table.
Since for this exercise we only need those particular values in our
list, set the .RowSourceType to 'ValueList'

6) Set the .RowSource to the list of values you want to be stored and
displayed separated by semicolons. The .ComboBox.Colum nCount property
controls how the list will be handled. In this example, we want to
store the code but display the translation. You will enter each row in
order: FirstOption.Cod e; FirstOption.Tra nslation; SecondOption.Co de;
SecondOption.Tr anslation; etc. If you wanted to display more columns,
just add those values in order and set the .ColumnCount property
appropriately.

Using your example, set the .RowSource to:

.RowSource = 1;Inactive;2;Du e;3;Received;4; Problems;5;Clea red

7) Set the .BoundColumn to 1. The bound column is the column to be
'bound' or stored in the base table. You can use any column as the
bound column if all columns are to be displayed in the .ComboBox
dropdown. In this example, we want to hide the 'Code' value, so
the .BoundColumn needs to be the first column in the list.

8) Set .ColumnCount = 2. We have 2 columns in our list.

9) Set .ColumnWidths = 0";1.5" . The display width of the Code
value is 0 so it will be hidden from display. The user will only see
the Translated value.

10) Set .ListWidth = 1.5" This controls how wide the entire dropdown
will be and it's annoying to have the displayed values cut off by the
default width.

11) Save your table.

Since you already have numeric values in the field, on opening the
table you will now see the Code Translation displayed. However, you
need to be aware that you are actually still storing the numeric value
when you pick from the dropdown list. This is important because if you
search that field for 'Inactive' you will get no hits - the stored
value is actually 1.

Good luck!

Ron, King of Chi

On May 9, 8:28 am, Elainie <Elaine.Macint. ..@bsc.wales.nh s.ukwrote:
I would like to convert data numbers to text.... i.e.
1 = Inactive
2 = Due
3 = Received
4 = Problems
5 = Cleared

Their is numbers in the fields at the moment but they need to be
converted to the words.... I have tried everything that I can think of
at the moment.... if anyone can help.

Elaine

There are many posts in this group explaining the pitfalls of using the
lookup feature in tables. Best practice appears to be, keep the lookup in
the forms using combo box or list box.
May 9 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
7287
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below. Specifically, I have a problem with this portion in the WHERE clause: DATEADD(Day,tblMyEventTableName.ReminderDays, @DateNow) Between CONVERT(smalldatetime,str(DATEPART(Month, @DateNow)+1) + '/' + str(DATEPART(Day, tblMyEventTableName.TaskDateTime)) + '/'...
1
1787
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance would be identical. I was 100% incorrect. The code below produces the results: CType Took: 0.2187528 seconds. Convert Took: 12.187656 seconds.
4
3633
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is of the type the object is instantiated with. In my test program I have Option<std::string> and Option<long>. Here's the code for OptionBase and Option along with a small helper function. In the code are comments describing my problem, look closely...
7
7119
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done without strtol or s/printf function. Thanks, whatluo.
3
10289
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function and there you have it. So I enquired and found the Convert class with it's promising ToInt32 method, great... but it doesn't work. The thing keeps throwing Format Exceptions all over the place. What is the "C#" way to do this??? code int wmin,...
7
29241
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
4
4523
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However it seems this convert is determined by the local settings and comma is indeed used as decimal separator. Is there another way to convert a dotted value to a double variable? Like 1234.5 and not 1234,5
1
3601
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
6
4265
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. this.ContentID = (int)ci.Conid; vs. this.ContentID = Convert.ToInt32(ci.Conid); I tend to use the latter form because it seems more descriptive to me, but it would be good to know what's best practice. I'm guessing those methods
0
10778
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
8997
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
9568
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
9389
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...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
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
4709
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...
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.