Results 1 to 2 of 2
  1. #1
    shenix2005 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    8

    Selecting Only Numerals from Text Box

    Hi,

    I have a text box in which i will enter both numeric and text datas [Examble: "0 to 20 sets" or "0 - 20 sets" ] like this.

    I will always enter two numerics and some texts like "to" or a "-" in between them. (the numeric can some times be negative also like
    -1 to 20 sets)

    Now i have another two text boxes where i need only the two numerals that i have entered omiting the "text" and "-".

    How is it possible? pls help.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    if you are sure there are two and only two space with the field, you can use instr to find the position of first space, then use left to extract the first number. and use instrRev and mid function to get second number:

    firstNumber: left([textfield], instr([textfield]," "))
    secondNumber: mid([textfield],instrRev([textfield]," "))

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

Similar Threads

  1. Selecting a corresponding table field based on text field.
    By michaeljohnh in forum Programming
    Replies: 5
    Last Post: 10-08-2010, 10:33 AM
  2. Selecting Dates
    By jpalk in forum Queries
    Replies: 3
    Last Post: 05-21-2010, 06:08 AM
  3. Selecting between two dates
    By nicorvp in forum Queries
    Replies: 5
    Last Post: 05-04-2010, 08:17 AM
  4. Selecting Just One Name Type
    By susan in forum Queries
    Replies: 1
    Last Post: 12-03-2009, 12:08 PM
  5. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 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