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:
If chkCustShipTo.Checked = True Then
If txtCustomerName.Text <> ".%" Then
ds.Tables("customer").Rows(inc).Item(0) = "." & txtCustomerName.Text
End If
Else
End If
I also tried, without any luck:
VB Code:
If txtCustomerName.Text <> "." & "%" Then
Thanks.
Re: Syntax - If TxtBox.Text <> ".Something"
try
VB Code:
if txtcustomername.text <> Like ".*" then
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'.
Re: Syntax - If TxtBox.Text <> ".Something"
VB Code:
If txtcustomername.text.StartsWith(".") Then
Re: Syntax - If TxtBox.Text <> ".Something"
What I ACTUALLY did was:
VB Code:
If chkCustShipTo.Checked = True Then
If Not txtCustomerName.Text.StartsWith(".") Then
ds.Tables("customer").Rows(inc).Item(0) = "." & txtCustomerName.Text
End If
Else
End If
Thanks wossname
Re: Syntax - If TxtBox.Text <> ".Something" [RESOLVED]