Results 1 to 6 of 6

Thread: Syntax - If TxtBox.Text <> ".Something" [RESOLVED]

  1. #1

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Resolved Syntax - If TxtBox.Text <> ".Something" [RESOLVED]

    All I'm wanting to do is check to see if the period has already been appended to the beginning of the customername text. If it has, then I want it to skip adding it again. I'm not sure what to put in the quotes after <> to show ".something". I thought it was %, but I guess not, because it's still adding it if the checkbox is checked.

    VB Code:
    1. If chkCustShipTo.Checked = True Then
    2.             If txtCustomerName.Text <> ".%" Then
    3.                 ds.Tables("customer").Rows(inc).Item(0) = "." & txtCustomerName.Text
    4.             End If
    5.         Else
    6.         End If
    I also tried, without any luck:
    VB Code:
    1. If txtCustomerName.Text <> "." & "%" Then

    Thanks.
    Last edited by milkmood; Jun 3rd, 2005 at 09:35 AM.
    When I say 'jump', don't waste time asking 'how high?'.

    Just a poor, dumb wanna-be programmer.

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Syntax - If TxtBox.Text <> ".Something"

    try
    VB Code:
    1. if txtcustomername.text <> Like ".*" then

  3. #3

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Syntax - If TxtBox.Text <> ".Something"

    I tried it. It would work if it was a database entry, but this is being done in the VB code before it ever touches the db. VS doesn't like 'Like'.
    When I say 'jump', don't waste time asking 'how high?'.

    Just a poor, dumb wanna-be programmer.

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Syntax - If TxtBox.Text <> ".Something"

    VB Code:
    1. If txtcustomername.text.StartsWith(".") Then
    I don't live here any more.

  5. #5

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Syntax - If TxtBox.Text <> ".Something"

    What I ACTUALLY did was:

    VB Code:
    1. If chkCustShipTo.Checked = True Then
    2.             If Not txtCustomerName.Text.StartsWith(".") Then
    3.                 ds.Tables("customer").Rows(inc).Item(0) = "." & txtCustomerName.Text
    4.             End If
    5.         Else
    6.         End If

    Thanks wossname
    When I say 'jump', don't waste time asking 'how high?'.

    Just a poor, dumb wanna-be programmer.

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Syntax - If TxtBox.Text <> ".Something" [RESOLVED]

    No problem.
    I don't live here any more.

Posting Permissions

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



Click Here to Expand Forum to Full Width