Results 1 to 3 of 3
  1. #1
    dada is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    40

    get a specific data in a string


    hi! let's say i have a record in my table that is "ADRD123", "ABCD12", "TERT321", "ERAR99". what i want to do is just show in my form the numbers only. like for example, "123","12","321","99". is that possible? is there a way to remove the first 4 characters starting from left? please help.. thanks!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    is the record full of string delimted by comma? or are those different fields in the form? are they bound fields or unbound? this all makes a difference. In general though:

    to remove the first 4 characters from the left of a string:
    Code:
    right(string, len(string) - 4)
    to display numbers only in a string:
    Code:
    dim c as control, i as integer, strOut as string
    
    for each c in me.controls
       for i = 1 to len(c.value)
          if isnumeric(mid(c.value, i, 1)) then
             strOut = strOut & mid(c.value, i, 1))
          end if
       next i
          c.value = strOut
    next c

  3. #3
    dada is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    40
    thanks! the first one solved my problem..

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

Similar Threads

  1. Code to pull in data from a specific record
    By jdunn36 in forum Access
    Replies: 1
    Last Post: 09-20-2010, 11:54 AM
  2. Replies: 7
    Last Post: 12-11-2009, 01:44 AM
  3. Converting/Viewing OLE Data as String...
    By oldgem in forum Access
    Replies: 0
    Last Post: 09-12-2009, 06:35 PM
  4. find specific data
    By hoachen in forum Queries
    Replies: 3
    Last Post: 08-19-2009, 08:54 AM
  5. Automatic Data Entry on a Specific Date
    By alanbrai in forum Programming
    Replies: 2
    Last Post: 11-14-2007, 05:15 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