Results 1 to 4 of 4
  1. #1
    msasan1367 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2013
    Posts
    60

    split characters

    how to split characters:


    example: my expression is
    2+12*1+10

    I want split this and put it to 4 text field
    field1: 2
    field2: 12
    field3: 1
    field4: 10

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    This is a value in a table field? Are all values in this same structure - the same math operators in same position and same number of terms? Consistency is critical when parsing strings. Assuming yes to all:

    x represents the field

    Val(x) = 2

    Val(Mid(x, InStr(x,"+")+1)) = 12

    Val(Mid(x,(InStr(x,"*")+1))) = 1

    Mid(x,InStrRev(x,"+")+1) = 10
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    msasan1367 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2013
    Posts
    60
    how about this string:
    2φ14+1φ16

    field1:2
    field2:14
    field3:1
    field4:16

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Looks like Greek lower case phi.

    Can use ASCII character codes with Chr() function in place of actual characters. As example, for the + sign:

    Val(Mid(x, InStr(x,Chr(43))+1))

    However, phi is not in the ASCII character set.

    Sorry, don't know how to work with Greek characters, only English.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. (bug) Chinese characters
    By JeroenMioch in forum Access
    Replies: 1
    Last Post: 08-09-2013, 09:15 AM
  2. Replies: 9
    Last Post: 02-11-2013, 03:09 PM
  3. Replies: 1
    Last Post: 12-14-2012, 01:10 PM
  4. How to count characters?
    By Jorge Junior in forum Access
    Replies: 1
    Last Post: 05-22-2011, 08:07 PM
  5. erase characters at the end
    By bjelinski in forum Access
    Replies: 14
    Last Post: 07-05-2010, 12:03 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