Here is my problem. I have a table that i query with a unique identifier. This identifier finds a record that lists 2 possible results 545 or 345. If the identifier returns 345 I need to convert that number into a word but if it returns 545 I can leave it as a number. I assume that I will have to write and if then statement but I don't know where and what to write. If anyone has any ideas or neeeds any clarification please let me know.
That is kinda close. Let me try this again. On my form I search the table with a unique number. This number returns a lot of information off of that table. if the search returns 345 then I want it displayed as a word. I can't change the data in the table because that is updated everyday with a numeric number. Maybe that is a little more clear.
There are many ways to do this (as is the case with all programming) and how you do it depends on how you are developing your application. The simplest thing to try is to have an unbound field that evaluates the data and acts upon it. I'm not sure this is exactly what you want, but this should you give you a start and you can play around till you get it how you want it:
In the unbound field control source, create an expression similar to
if [id] = 345 then "What your text should be" else [id]
First, rename the textbox that you are using. When you look at the Properties for the textbox it is in the Other tab. It is probably 'Type'. Change it to 'txtType'. Then, as the ControlSource put in:
This is an Immediate If statement and there are three parts to it. The first part is the condition ([Type]=345), the second is what you will get if it is true ("YourWordHere"), and the third is what you get when the condition is false ([Type]).
This is considered a calulated field and it is only for display purposes. Do you need to modify it and have it saved in the table?
The renaming is important, if you don't rename the textbox then you will get an error.