• 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.
  • Posts

    • Wrong again. Electric vehicles are more reliable than gasoline vehicles because they have fewer points of failure. On average, they last 50% longer. Its your right to be incorrect and my right to correct you.
    • Hello, I am using a Hitron CODA56 cable modem with Comcast Xfinity's 1200 Mbps service.  No issues noted.  I had looked at the Motorola and Netgear options for a cable modem, but neither was available for purchase at the time I upgraded my cable connection. There are multiple models in the Netgear Nighthawk X10 line-up.  I am guessing you have either the the Netgear Nighthawk X10 AD7000 model (R8900) or the Netgear Nighthawk X10 AD7200 model (R9000) model, is that correct?  Both of these only have one gigabit WAN (internet) ports for connection to the modem, all of the remaining ports for the LAN side of things are gigabit Ethernet ports.  The 10GbE port on the devices is meant for connection to local NAS storage.  I suppose you could connect the desktop computer directly to it, although it would still be limited by the gigabit connection between the cable modem and the Netgear residential gateway broadband router. I would suggest looking for a residential gateway broadband router from a company like Asus, Netgear, TP-Link or maybe even Ubiquiti, depending upon budget, that has 2.5Gbps (or faster) WAN and LAN ports.  That would allow you to make full use of the 1.2Gbps connection from your ISP as well as have some room for future growth, speed-wise. Regards, Aryeh Goretsky      
    • Firefox 140.0.1 by Razvan Serea Firefox is a fast, full-featured Web browser. It offers great security, privacy, and protection against viruses, spyware, malware, and it can also easily block pop-up windows. The key features that have made Firefox so popular are the simple and effective UI, browser speed and strong security capabilities. Firefox has complete features for browsing the Internet. It is very reliable and flexible due to its implemented security features, along with customization options. Firefox includes pop-up blocking, tab-browsing, integrated Google search, simplified privacy controls, a streamlined browser window that shows you more of the page than any other browser and a number of additional features that work with you to help you get the most out of your time online. Firefox 140.0.1 fixes: Fixed text contrast issues in the sidebar with some dark themes. (Bug 1971487) Fixed a startup crash experienced by some users caused by DLL injection. (Bug 1973947) Download: Firefox 64-bit | Firefox 32-bit | ARM64 | ~60.0 MB (Freeware) Download: Firefox 140.0.1 for Linux | 64-bit | ~90.0 MB Download: Firefox for MacOS | 127.0 MB View: Firefox Home Page | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      Marites earned a badge
      Week One Done
    • One Year In
      runge100 earned a badge
      One Year In
    • One Month Later
      runge100 earned a badge
      One Month Later
    • One Month Later
      jfam earned a badge
      One Month Later
    • First Post
      TheRingmaster earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      575
    2. 2
      ATLien_0
      184
    3. 3
      +FloatingFatMan
      178
    4. 4
      Michael Scrip
      136
    5. 5
      Xenon
      119
  • Tell a friend

    Love Neowin? Tell a friend!