Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Searching a string for a specific character (A2K Sr1)

    Can someone tell me what code to use when looking at a string to tell me if a specific character exists in that string? Example: E-mail address. I want to look at the string to see if "@" exists and return a 1 or 0.

    Thanks,
    Mark Santos

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching a string for a specific character (A2K Sr1)

    Something like this:

    <pre>Public Function bCkForAt(strAddress As String) As Boolean
    bCkForAt = InStr(strAddress, "@") > 0
    End Function
    </pre>

    Legare Coleman

  3. #3
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching a string for a specific character (A2K Sr1)

    I agree that what LegareColeman has submitted will work with "no problem" .........

    You can also do this without the need of a "User Defined" function by using an IIf statement:

    =IIf(InStr([FieldName],"@")>0,1,0)

    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •