Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    moke123,
    Thanks for the advisory, but we're back in Canada. It looks like anywhere from Miami to Melbourne could take the hit.


    I saw one weather update that suggested anywhere from the Florida keys to the Georgia border.

    Re the email data, I agree ---hidden characters or variation in the input data --

  2. #17
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    Thank you all, will give the code a try and hope you are not caught in the weather orange......

    much appreciated

  3. #18
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    Hi orange, yes this is great, the left function pops up twice as mid and right function, the mid function is what i need to go to txtMailMessage

    If i am correct is it something like me.txtMailMessage = strStart ?

  4. #19
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    If it's Johns code in post #14 your referring to, it would be something like

    me.txtMailMessage = StringPart(enter your arguments here)

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Dave, Thanks for the info, but I believe you are referring to John's code as moke123 said in post #19.

    I am back in Canada, but thinking of those in Florida and the east coast.

  6. #21
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    As seems, finally, someone lost in the storm of responses.

    Sorry, I had to describe correctly:

    The function StringPart() returns a part of a string defined of the position of specific string(s).

    Syntax:
    StringPart(strText,[strFrom],[strTo],[ExFrom],[ExTo])

    Arguments:
    strText: Required. String. The whole text.
    strFrom: Optional. String. The start of part.
    strTo: Optional. String. The end of part.
    ExFrom: Optional. Boolean. True for exclude strFrom.
    ExTo: Optional. Boolean. True for exclude strTo.

    Usage:
    With only the second argument (strFrom), returns the right part from the first occurrence of the strFrom in the strText, including the strFrom. Works like Right() function. If not found, returns the whole strText*. If the ExFrom is True, returns the right part from the end of the first occurrence of the strFrom (exclude the strFrom).

    With only the third argument (strTo), returns the left part of the strText up to the first occurrence of the strTo, including the strTo. Works like Left() function. If not found, returns the whole strText*. If the ExTo is True, returns the left part of strText up to the begining of the first occurrence of the strTo (exclude the strTo).

    If both strFrom and strTo are passed, returns the part of the strText between the first occurrence of the strFrom and the first occurrence of the strtTo. Works like Mid() function. ExFrom and ExTo, if are true, eliminates the search strings from the returned part.

    * Maybe should returns an empty string. If so, comment/delete the line strMid = strText in the block of the StringPart() function.

    So Dave, based on the code of Sub TestStringPart() in post #14, could be me.txtMailMessage = StringPart(strOld, strStart, strStop, True, True)

    I hope I was more clear.

    Cheers,
    John

  7. #22
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    Hi John, absolutely nailed on, this works and solves it fully, i would like to thank you so kindly to all of you have helped, where do i add resolved on here because I should mark resolved and once again thank you, i am going to study this so i can potentially use elsewhere if needed.

    Kindest

  8. #23
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Dave, you're welcome!
    Happy to help.

    * Maybe should returns an empty string. If so, comment/delete the line strMid = strText in the block of the StringPart() function.
    Please ignore the above in quote. Is not so easy as I thought initially and, in addition, I think that should return the whole string if search strings not found.

    Cheers!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-25-2015, 02:10 AM
  2. Replies: 7
    Last Post: 06-20-2014, 08:55 PM
  3. Trim!
    By redbull in forum Programming
    Replies: 9
    Last Post: 11-06-2012, 06:01 AM
  4. how to trim text in a column using sql query of ms access
    By learning_graccess in forum Access
    Replies: 4
    Last Post: 12-05-2011, 07:15 AM
  5. Trim value
    By dada in forum Programming
    Replies: 5
    Last Post: 09-02-2010, 11:01 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