Results 1 to 9 of 9
  1. #1
    InsaneJammer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    4

    Using Caluculated fields to return text

    I have a field where the values are limited to 5 or 6 values, e.g., 162,600,400, etc, but the field data type is text. the numbers are not to be used in calculations, they are just parts of a name.(162S124-18) What I want to do is, in another field, return a different string for each of the values.


    I've areadey done this with nested iif functions with no problem, the only difference is in this case I want to return text intead of numerica characters, and it won't except this.
    Here is an example of a function that work's:
    IIf([Mils]=18,25,IIf([Mils]=27,22,IIf([Mils]=30,20,IIf([Mils]=33,20,IIf([Mils]=43,18,IIf([Mils]=54,16,IIf([Mils]=68,14,IIf([Mils]=97,12,0))))))))

    Now If i take this same function and as the true argument,enter, S, or "S", it returns an error. If I enter the true argument as "S", It allowws the expression to go, but whne I save it I get the error.
    Does anyone know what I'm doing wrong?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    when you "save it"?? what does that mean?

  3. #3
    InsaneJammer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    4
    I'm in design view and have to save before I can go to data sheet view.

  4. #4
    InsaneJammer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    4
    the erroe message is " cannot accetpt null or binary"

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by InsaneJammer View Post
    the erroe message is " cannot accetpt null or binary"
    upload the db

  6. #6
    InsaneJammer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    4
    It won't upload, says invalid file, believe it's too big.

  7. #7
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    OK. I just don't have time to stay on with this thread. good luck!

  8. #8
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I think I'd use a lookup table. I'm not sure how you pinpoint the characters you're trying to convert, but I would put the values in a table and then add the lookup table to your query. Sorry if that's kind of vague.

    Jim

  9. #9
    wes is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    29
    Quote Originally Posted by InsaneJammer View Post
    It won't upload, says invalid file, believe it's too big.
    I can't help with your initial question, but as for uploading, if you make it a zip file it should be small enough to upload. Or you could create a small sample db that only has the pieces you need folks to comment on. Whatever you post should be formatted for an earlier version (maybe Access 2003?) so more people can use it. It really helps people to have something to play with rather than just a description.

    For more info check out https://www.accessforums.net/faq.php...b3_attachments

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 03-06-2011, 04:10 AM
  2. Replies: 1
    Last Post: 11-05-2010, 04:31 PM
  3. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  4. fields of type text
    By ashiers in forum Forms
    Replies: 0
    Last Post: 11-28-2008, 10:52 AM
  5. Split text field into two text fields
    By Grant in forum Access
    Replies: 6
    Last Post: 01-31-2008, 05:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums