473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Ensuring a user won't input a string when single is expected...

3 New Member
Im making a program which works with singles.

I want to ensure when they input data into an inputbox
they don't enter a string or letter - and provide my own erroe message

The val and isnumeric functions seem to be a good choice.
having difficulties though

help appreciated
Mar 8 '08 #1
5 876
debasisdas
8,127 Recognized Expert Expert
You need to check the data for the proper format and reprompt if format is wrong.
Mar 8 '08 #2
shadowbeam
3 New Member
Apologies, I've been coding for half a year now in VB

Not thoroughly certain with all the functions. My knowledge is very limited.

Could you please give me an example?
Mar 8 '08 #3
Killer42
8,435 Recognized Expert Expert
What version of VB are you using?

Also, in general I would discourage the use of InputBox() function. You really should create your own user interface, as InputBox doesn't allow enough control over what the user does. Probably the ideal control to use for your own input handling would be the MS Masked Edit control. This is like a text box, but allows you to control what will be accepted.
Mar 10 '08 #4
shadowbeam
3 New Member
Its an old version. Computers at my school are really old.
Running windows 2000
Mar 10 '08 #5
Killer42
8,435 Recognized Expert Expert
Its an old version. Computers at my school are really old.
Running windows 2000
My guess would be VB6 or VB5, then.

In any case, the Masked Edit control will provide you much better control over input, as I said. Otherwise, can you tell us what "difficulties" you're experiencing using the Val() function and so on?
Mar 10 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
0
by: foldface | last post by:
Hi I have an odd problem with a user control. - I have an asp page which holds a single usercontrol. - On that user control I have a button and placeholder. When the button is pressed I want a...
3
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the...
19
by: Siobhan | last post by:
Hi What is the recommended way to store a user's database credentials across the pages of a web application so that each time the database is accessed the system doesn't have to ask them for their...
6
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards,...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
2
by: teddysnips | last post by:
This is sort of an addendum to my previous post entitled: "Restrict FE application to one user at a time". My preferred design is to have a table with a single row that contains the network name...
28
by: n00m | last post by:
Both codes below read the same huge(~35MB) text file. In the file 1000000 lines, the length of each line < 99 chars. Stable result: Python runs ~0.65s C : ~0.70s Any thoughts?
9
by: arnuld | last post by:
Earlier, I have posted a program like this, a month ago IIRC. I have created it again, without looking at the old program. Can I have your opinions on this: 1) I wanted my program to be...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.