|
-
Jun 3rd, 2005, 09:13 AM
#1
Thread Starter
Lively Member
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.
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.
-
Jun 3rd, 2005, 09:16 AM
#2
Re: Syntax - If TxtBox.Text <> ".Something"
try
VB Code:
if txtcustomername.text <> Like ".*" then
-
Jun 3rd, 2005, 09:27 AM
#3
Thread Starter
Lively Member
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.
-
Jun 3rd, 2005, 09:28 AM
#4
Re: Syntax - If TxtBox.Text <> ".Something"
VB Code:
If txtcustomername.text.StartsWith(".") Then
I don't live here any more.
-
Jun 3rd, 2005, 09:33 AM
#5
Thread Starter
Lively Member
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
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
-
Jun 3rd, 2005, 09:52 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|