Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Red face Unanswered: Converting a value to text

    I am using access 2003. I am really new to access and databases in general. I have a value in a field that i need to convert to text. Such as the value is 1 and the text that correlates is meets, the value is 2 and the text is does not meet. I dont care if I have to convert the value at the table, query, or report level...any of them will do.

    This is probably a very simple question and answer but I cant figure it out or find the answer.

    Thanks a lot.

  2. #2
    Join Date
    May 2009
    Posts
    104
    You question is a little confusing. Is the data in the field you want to convert formatted as a text field? I would assume no. You can create a field in the same table that will receive the converted data, format it as a text field, then create an update query to transfer the data over to the new field. When your done you should be able to switch the field names. If you just change the format from whatever it is now to text you may loose data.

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can use the CStr() function or the Str() function. For more specific treatment you can also use the Format() function which always returns a strung value. Ex (in a form):
    Code:
    MyString = CStr(Me.MyField.Value)
    If the control (or the field) MyField can contain a Null value, use:
    Code:
    MyString = CStr(Nz(Me.MyField.Value, ""))
    Or:
    Code:
    MyString = CStr(Nz(Me.MyField.Value, 0))
    Otherwise an error will occur in case of Null (Null cannot be converted to a string).
    Have a nice day!

  4. #4
    Join Date
    Aug 2011
    Posts
    3
    I appreciate the answer but that ones a little over my head. Thanks anyway.

  5. #5
    Join Date
    Aug 2011
    Posts
    3

    Smile Reply to dbshaft

    That ones more my user level....You are correct the data that I am trying to convert is a number field. Gonna start working on the update query. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •