• 0

[VB] I need a "not like" statement


Question

haha, Ive been milkin you guys with all my VB problems today ;)

Alright so I have a check to make sure that the number entered is actully a #, it goes:

If min.Text Like "#" Then betch.Value = 1

thing is farther dow I want to have another check where if it detects anything but a number I want it to set betch.value to 0. So bascilly what Im looking for is a "not like" command or any workaround. Thanks, you guys have been of great help to me on this project of mine.

Link to comment
https://www.neowin.net/forum/topic/470938-vb-i-need-a-not-like-statement/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

oh man, thank you. this forum has made me feel stupid multiple times now. argg!! :) seriously though thanks for that.

EDIT: hmm it works but not very well, if I cant figure out whats wrong in the next few minutes Ill post it up here.

EDIT: I figued it out, I needed the "Else betch.Value = 0" on both levels of my nested if.

EDIT: alright probelm # 2. I have this line of code:

 If hour.Text Like "#" Then
--long list of stuff down here but adventuly turns off something

problem is, as you may know, an hour can be 1 digit, or 2 digits. What Im looking for this time is like an

if hour.text like "#" or "##" then

kind of command, any ideas on this one?

If I dont get a response Ill make anew thread.

Edited by hobblyhoy
  • 0

Just put the isnumeric() in an if statement

I dont know if this is the exact syntax for VB because I havnt touched it in almost a year.

if isnumeric(textbox1.text) then

textbox2.text = "ITS A NUMBER!!!"

else

textbox2.text = "ITS NOT NUMBER!!! WHY NOT???"

end if

  • 0
  Quote
EDIT: alright probelm # 2. I have this line of code:

If hour.Text Like "#" Then

--long list of stuff down here but adventuly turns off something

problem is, as you may know, an hour can be 1 digit, or 2 digits. What Im looking for this time is like an

if hour.text like "#" or "##" then

kind of command, any ideas on this one?

If I dont get a response Ill make anew thread.

again ur right alredy :p

if hour.text like "#" or hour.text like "##" then

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.