Results 1 to 6 of 6
  1. #1
    memaxt is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2013
    Posts
    13

    Help: ID number surrounded by symbols

    Hi there,



    I have a form where user input their references but unfortunately the reference numbers they have inputted separated via commas, semi-colons, apostrophes

    i.e 500, 501, or 501; 502; or "501", "502" or even 500, '502'

    is there away if i click the number itself i.e 500 it will take me to the corresponding record? even though its surrounded by symbols?

    Many thanks
    Max

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    I dont see how they are ENTERING data....if its from a form they wouldnt need to put the quotes or commas.

    You may have to do some parsing...cleanup before it gets to the query...like: LEFT(txtBox, 3) or the like.

  3. #3
    memaxt is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2013
    Posts
    13
    Hi there,

    Its imported data from a website, going forward I wont allow them to use such symbols.

    Apologies I'm not quite up to scratch with parsing, are you able to guide me a little more on how i would do this.

    Many thanks
    Max

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    It's not as easy as it looks - if the reference numbers are all in one field (which from your description is the case), then when the control is clicked, you have to determine where the mouse cursor is in the field, and then figure out what number is underneath the cursor (if there is one).

    The Selstart property will give you the location of the cursor when the control is clicked, but beyond that, you will need VBA to what the number is. Access knows only that the control contains text (characters).

    HTH

    John

  5. #5
    memaxt is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2013
    Posts
    13
    Hi John,

    Many thanks for your response, sounds little confusing to how i would go around this, I've decided to do a Control Find and replace, and remove all symbols so it would leave the textbox with clean reference numbers i.e. Reference Number(s): 500 501 502

    being able to click one of those numbers and to go to record seems possible at the moment.

    Many thanks
    Max

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Seems possible or impossible?

    This is not a normalized data structure. Even a multi-value field might be preferable, and I don't use multi-value fields.

    Parsing can be done with string manipulation functions (Left, Right, Mid, InStr, Len). Access Help has more info. Also, VBA code can parse the string to an array. However, any approach used requires data to be consistent structure. All those variations in punctuation would be an issue so it's a positive move that you are dealing with that much.

    Suggest a non-bound textbox for user input of parameter and use that as criteria for search.
    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. How To Add MICR Font Symbols to Forms
    By dennisjoven in forum Forms
    Replies: 1
    Last Post: 03-17-2014, 03:57 PM
  2. Replies: 2
    Last Post: 09-18-2013, 09:58 AM
  3. Replies: 9
    Last Post: 08-19-2013, 05:55 PM
  4. Symbols in the data (problem?)
    By dccjr in forum Access
    Replies: 2
    Last Post: 02-27-2013, 07:01 PM
  5. The search for "quote symbols"
    By Dadmail in forum Queries
    Replies: 1
    Last Post: 03-18-2009, 10: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