Results 1 to 3 of 3

Thread: compare

  1. #1
    Join Date
    Sep 2005
    Posts
    28

    Unanswered: compare

    In VB

    How can I compare 2 string?

    I created 2 text box, one is called [Vendor Name], another one is called [VN]

    then I write

    if ([Vendor Name] = [VN]) then

    it seems does't work, how can I compare 2 text box values?

    Please help.

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Code:
    If Me.[Vendor Name] = Me.[VN] then
    MsgBox"THEY MATCH!"
    Else
    MsgBox"THEY DON'T MATCH!"
    End IF


    .
    Last edited by CyberLynx; 09-26-05 at 04:46.
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    Or you could use.......

    If StrComp(Me.[Vendor Name] = Me.[VN]) = 1 Then
    MsgBox "THEY MATCH!"
    Else
    MsgBox"THEY DON'T MATCH!"
    End If
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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