+ Reply to Thread
Results 1 to 3 of 3

Thread: Using InStr Function

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Using InStr Function

    Hello,

    I have a variable which holds a value.

    str="Student Deposit: Session 123"

    If the str variable has the word Student Deposit I want to display a message

    So i used the Instr function but it didnt work out.

    How can I search in str variable that it holds the words Student Deposit.

    todd

  2. #2
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    hey todd,

    i think maybe like this in your where clause:

    str="Student Deposit: Session 123"

    try:

    str="%Student Deposit%"

  3. #3
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    You can use InStr like this:
    Code:
    If InStr(str, "Student Deposit") > 0 Then
        ' Display the message
    End If
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Similar Threads

  1. Help using function
    By Rebelle in forum ASP Development
    Replies: 11
    Last Post: October 13th, 2008, 01:13 PM
  2. ASP 2 way encryption function
    By dr_rock in forum ASP Development
    Replies: 2
    Last Post: August 14th, 2008, 09:01 AM
  3. without function
    By guddu in forum Microsoft SQL Server
    Replies: 1
    Last Post: July 15th, 2008, 05:02 PM
  4. Function USerName(ID)
    By Shem in forum .NET Development
    Replies: 25
    Last Post: July 8th, 2008, 11:32 AM
  5. ASP Trim Function
    By todd2006 in forum ASP Development
    Replies: 2
    Last Post: May 8th, 2008, 02:17 PM

Bookmarks

Posting Permissions

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

SEO by vBSEO