473,503 Members | 11,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How will i locked the numeric/character. please help me!!!

50 New Member
I created a system and I have a problem regarding the data that will be inputted. Example the required data to be inputted is character only and another thing if the required data to be inputted is numeric only. how will i locked the numeric/character so that the data that will be stored will be come reliable and accurate. Can yuo help me guys. I dont know the proper codes to be use.
Oct 3 '07 #1
10 1673
hariharanmca
1,977 Top Contributor
What version of VB you are using?

VB 6.0 or VB.NET
Oct 3 '07 #2
bluethunder
50 New Member
What version of VB you are using?

VB 6.0 or VB.NET
Im using VB 6.0 Can you please help me.
Oct 3 '07 #3
hariharanmca
1,977 Top Contributor
Im using VB 6.0 Can you please help me.
Use keyascii value to lock characters like

For allow only numbers.
Expand|Select|Wrap|Line Numbers
  1.     If Not (KeyAscii = 8 Or (KeyAscii >= 48 And KeyAscii <= 57)) Then
  2.         KeyAscii = 0
  3.     End If
and try for alphabet your self.
Oct 3 '07 #4
bluethunder
50 New Member
Use keyascii value to lock characters like

For allow only numbers.
Expand|Select|Wrap|Line Numbers
  1.     If Not (KeyAscii = 8 Or (KeyAscii >= 48 And KeyAscii <= 57)) Then
  2.         KeyAscii = 0
  3.     End If
and try for alphabet your self.
ok, what about numeric how will i locked it...
Oct 3 '07 #5
hariharanmca
1,977 Top Contributor
Use the event method like

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBoxName_KeyPress(KeyAscii As Integer)
Oct 3 '07 #6
bluethunder
50 New Member
Use the event method like

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBoxName_KeyPress(KeyAscii As Integer)
ok, the locking of numeric is it the same with locking the characters that you have gave to me..
Oct 3 '07 #7
hariharanmca
1,977 Top Contributor
Yes find the KeyAscii value for A-Z and a-z then prepare your code.

Good luck.
Oct 3 '07 #8
bluethunder
50 New Member
Yes find the KeyAscii value for A-Z and a-z then prepare your code.

Good luck.
thank you sir for the big help and the time that you spend..
Oct 3 '07 #9
creative1
274 Contributor
good job hari
I do the same thing when restricting fields. What should I do if I want to restrict a text box to numeric entries (with decimal point such as 3.22 4.999 59.99 etc)
I accumplished the task by using some flags for decimal point. I thought my method is too rough. is there a better way to do that?
farhana
Oct 3 '07 #10
hariharanmca
1,977 Top Contributor
Read entire text
Use inStr() to find “.
If it is there then keyascii = 0
Oct 3 '07 #11

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

Similar topics

3
2307
by: Lodewijk van Haringhal | last post by:
I'am new with javascritping not with programming. Is there nobody who can help me with ths simple promblem? :) Please, please give me a hint. Please help me with this script. I have two lists in...
1
1529
by: aarthy | last post by:
Hi, I have a problem in the display of the ASP screen actually i am retrieving and displaying the data from a database when the view button is hit.The contents for display is so long so i want...
1
3694
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
21
2078
by: softwindow | last post by:
#include "stdio.h" #include "malloc.h" struct student{ int age; char *nms; struct student *next; }; struct student *create(){ int ags=0,size=sizeof(struct student); char *nms=" ";
0
1885
by: magicofureyes | last post by:
Hello Guys im a just a new user and i dnt knw much abt Xml i want to upload a new template in Blogger so got some free coding but when i save this code in Blogger template it say '''' Your...
6
3939
by: stefaniefauconnier | last post by:
I've got some html-files with a lot of greek characters in utf-8. When I open my source code, I don't see the numeric character reference but the character itself. How can I change this? I really...
0
991
by: William Heymann | last post by:
How do I decode a string back to useful unicode that has xml numeric character references in it? Things like 占
3
2195
by: Echidna | last post by:
Hi All, Wondering if anyone has encountered this one, and if anyone has a solution (or an insight into what's going wrong) This has been bugging us now for quite a while, and cannot find a...
0
7098
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
7296
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
7364
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
7470
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
5604
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,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
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
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
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.