Question Coverting values to words

Soundman

New member
Local time
Today, 08:43
Joined
Oct 7, 2013
Messages
4
I have form using a toggle option with four buttons. The values are 1,2,3 & 4. How can I convert the values to read (in the table) as words instead of values.

Example
1=dog
2=cat
3=bird
4=hamster

Please know I'm a novice with VBA, so if VBA is needed to resolve this, please be descriptive.

Thanks in advance for your reply!
 
Rather than editing my original question should perhaps ask or say.......I can easily do this with excel using an "if" statement, but not sure if, or how this can be done inside access. Seems to me this would/should be simple, however, I can't quite figure it out.

Again, thanks in advance
 
You need to clarify:

Is the field in your table the control source to your toggle button? If yes and the field is text, you cannot use an option control. If no, how are you converting the text back to a number for the option control?

Do you really want your table to store 'dog', 'cat', etc rather than a number? - bearing in mind you can easily display 1,2, etc as dog, cat etc in a form, report or query?

I guess I'm trying to say you should not look at tables directly - except perhaps during development and tables should contain what you need for the system to work, not what you want to see because it is sometimes easier to look at the table with a translated value rather that writing a query:)
 
You need to clarify:

Is the field in your table the control source to your toggle button? If yes and the field is text, you cannot use an option control. If no, how are you converting the text back to a number for the option control?

Do you really want your table to store 'dog', 'cat', etc rather than a number? - bearing in mind you can easily display 1,2, etc as dog, cat etc in a form, report or query?

I guess I'm trying to say you should not look at tables directly - except perhaps during development and tables should contain what you need for the system to work, not what you want to see because it is sometimes easier to look at the table with a translated value rather that writing a query:)

I'm using access to register members of a fraternal organization for conventions. As their information is entered on the form, the degree they hold is entered by way of a toggle button. (BTW, nothing to do with dog,cat etc, I just used that as an example)..There are 4 degrees to choose using the toggle option buttons.

Once a person's info is entered into the form, a "credential' is printed out and placed into a lanyard as proof the member is registered for the convention. We are using the option (toggle) button to select the degree the member holds. This button not only uses VBA to assign and print a logo associated with their degree, it also is a control to a field inside a table using values (1-4). True example: 1=Candidate, 2=Moose Legionnaire, 3=Fellow,4=Pilgrim.

Here's my problem....the "Degree Field" inside the table now shows as 1,2,3,or 4.. Not a problem until now because it's understood what number corresponds to what degree. However, we now want to use "Adobe Forms Central" for online pre-registration and the online form will allow an export to excel, which will be used to import into the access table. The online form will offer the wording of degrees (Candidate, Moose Legionnaire, Fellow & Pilgrim), not the numbers 1-4.

So importing the data from "forms central" into the "degree" field will have the wording for their degrees, but manual entry using the form (for those registering onsite and not imported through forms central) will show 1-4 in the degree field.

Bottom line is: In order to import the excel file from forms central into access, need a way to convert...

1) the imported data coming from "forms central" (example): convert from "Candidate" to "1" in the degree field..or

2) Have the toggle button values from access read as (example) "1" reads as "Candidate".

It seems it would be better for me to simply have the values (1-4) converted to the text "candidate" instead of "1" into the "degree" field in order to avoid altering an Excel file to be compatible for import into the access table.

My apologies for such a confusing issue, it's hard to explain in written format. Thanks so much for your reply.
 
Last edited:
In that case, I would leave the numbers as you have them in the table and export a query to excel rather than the table.

In your query use the Choose function, rather than iif i.e.

Code:
Choose(FratFld,'dog','cat','fish','bird')
it's hard to explain in written format
If this doesn't meet your requirements, suggest you upload a copy of the db with some test data plus a copy of the output required
 

Users who are viewing this thread

Back
Top Bottom