Results 1 to 6 of 6
  1. #1
    eladz949 is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    9

    transforming text to number

    Hello



    i have a form where the user chooses the text value he wants, using a check box. i want to export data via a query to a text file and i want the text value to have number values. for example if the user checks yellow the number outputed to the text file will be 1, red - 2 and so on...

    how can i do it???

    Thanks in advance!!!

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What I would do instead of individual check boxes is use an Option Group instead. the value stored is a number by default and you can just label the individual radio buttons the colors to match the order you want. Also, I believe that an option group starts at 0 and not 1 so you may need to modify things.

    Hope this gives you a good start.

  3. #3
    eladz949 is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    9
    thanks a lot for the fast reply!!

    it does the labeling and the values exactly how i wanted but the problem is that i need it to be a combo box, because i have 1440 values so check box is not good.. (option group creates check box..)

    Any idea what i should do???

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    That's even easier. Create a table that holds the values and the numbers assigned to them. Do a query that selects the number first then the text. Set the combobox to that query. Now you have a combo box with 2 columns. In the properties, set the width of the first column to "0". This will remove the numbers, making it look cleaner. Then set the "bound column" to the first one.

  5. #5
    eladz949 is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    9
    wow! YOU ARE THE MAN!!

    works perfectly.. thanks

  6. #6
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Glad to help.

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

Similar Threads

  1. Count Text as Number
    By AccessFreak in forum Forms
    Replies: 1
    Last Post: 01-04-2011, 12:49 PM
  2. Number stored as text
    By Mclaren in forum Programming
    Replies: 1
    Last Post: 05-15-2010, 03:11 AM
  3. Dividing a number stored as text
    By Mclaren in forum Programming
    Replies: 1
    Last Post: 05-04-2010, 07:50 AM
  4. Concatenation of Text and Number
    By diane802 in forum Reports
    Replies: 67
    Last Post: 01-26-2010, 03:37 PM
  5. exporting text produces a number
    By greend in forum Import/Export Data
    Replies: 0
    Last Post: 07-12-2006, 03:55 PM

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