I was wonder how i would go about limiting a length of a string that is going to be entered into a text box. An example my explain this better:
the data is coming from a barcode that reads: ABCDEF 1a2b3c
as you can see there are two sections one letter sections and one alphanumeric section. the first is only 6 characters long and then a space and then a set of 6 alphanumeric charaters. If this is being entered into a text box/combo box is there a way to only use the first 6 characters, ABCDEF, from the string??
Thanks for the advice
developing in ms access 2000
9 2558 Rabbit 12,516
Recognized Expert Moderator MVP
You'll want to look at input masks from the help file, gives you all the info you need.
Well i have the input mask working correctly, except that space between the two data sections must be a carraige return.This causes a problem when i go to my lostFocus event property of the text box i use a dcount to see if that value is in the list. Since there is a carraige return once the data is entered it will also try to insert the record when not all data fields are full so how can i just ignore any characters after the first 6?
Rabbit 12,516
Recognized Expert Moderator MVP
I'm not following. Could you explain again and provide an example?
I'm not following. Could you explain again and provide an example?
So what happens is the user selects the first text box and will scan a barcode that contains the following: ABCDEF 1a2b3c. What happens is the the text box will then have the data ABCDEF, which is the information that i need since it is a userID. But then the ' ' (blank space) in the middle of the bar code data is a carriage return so once it is read it will either go to the next field or execute the command button. So if the focus of the form goes to the next field then the 1a2b3c is displayed, which i dont want; and if there is a command button on the form then it will be executed. So the problem is that i dont want anything after the sixth character to be read.
Let me know if you need more explaining.
Rabbit 12,516
Recognized Expert Moderator MVP
I've never used a bar code scanner with Access before so I don't know how it works.
However, I assume the bar code scanner comes with software? Rather than a carriage return could you get the scanner to return something else?
In Access you can also change the behavior of the Enter key. I forget exactly where it is right now.
Also, are you able to intercept and manipulate the information from the barcode scanner before it enters the form? If so you can use just the first 6 characters.
If you could tell me more about how the barcode scanner works with Access I could probably come up with more ideas.
Well the scanner's input is just in the form of another listener, it works the same as a keyboard basically. The only difference between the two is that with a keyboard you type each character in whereas with the scanner is it a full string. Now as far as for the software for the scanner, there really is none all you need to do is download a barcode font for something like ms word and you can make any barcode you want. The only rule you have to follow is the barcode must start with a *, and end with a * (by * i mean its barcode equivalent). And you can do this because the scanner will take the barcode and convert it into ASCII characters and display it to the screen or where ever. But for the project i am working on i cant really change the format of the existing bar codes, so i am stuck with the 'ABCDEF 1a2b3c" format.
So what i tried to do is make a blank text box (tab index 1) that has the index right after my user name text box (tab index 0) so when the carriage return is recogized the second part of the barcode, 1z2b3c would go to the second text box which i got to work. Then i tried to make the second text box not visible so you wouldnt see the 1a2b3c data from the bar code and the data would just be ignored. but the problem i had with that was once i set the second text box to not visible the 1a2b3c data would just be entered into my tab index 3 field, which i dont want.
let me know if that doesnt make sense or you need more explaination
Rabbit 12,516
Recognized Expert Moderator MVP
If that's the case then I think you'll need to either leave that textbox visible and put it somewhere where it can't be seen or change the behavior of the carriage return. I'm pretty sure it's one of the options.You can tell it not to move on to the next tab stop.
EDIT: It's in Tools>Options under the Keyboard tab. In the Enter key behavior. Hopefully turning it off will work for the barcode scanner. Otherwise I think your only option is to make the extra textbox really small and hide it behind another control.
Well thanks for the input, ill try out that stop tab option and if that doesnt work ill just have to hide it. Thanks for the help, I really appreciate it. I just started working with access like 1.5 months ago for an intership so i dont know all the ins and outs yet but i learn new stuff every day. Thanks again.
Rabbit 12,516
Recognized Expert Moderator MVP
Well thanks for the input, ill try out that stop tab option and if that doesnt work ill just have to hide it. Thanks for the help, I really appreciate it. I just started working with access like 1.5 months ago for an intership so i dont know all the ins and outs yet but i learn new stuff every day. Thanks again.
Not a problem, good luck. Maybe one of the other experts will know of a better way to do it.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Randell D. |
last post by:
Folks,
I have a SELECT that returns with multiple records - It works when I have a
LIMIT clause but when I try to include a GROUP BY clause, the select returns
nothing (ie no records, no errors).
The GROUP BY specifies a column that does exist in my db (and is also the
only field that is select from the db).
Where am I going wrong? Because my select uses hashes (which I provide with
|
by: maniac |
last post by:
Hey guys, I'm new here, just a simple question.
I'm learning to Program in C, and I was recommended a book called,
"Mastering C Pointers", just asking if any of you have read it,
and if it's worth the $25USD.
I'm just looking for a book on Pointers, because from what I've
read it's one of the toughest topics to understand.
thanks in advanced.
|
by: VM |
last post by:
How can I limit the use of the PC's virtual memory? I'm running a process
that basically takes a txt file and loads it to a datatable. The problem is
that the file is over 400,000 lines long (77 MB) and after a while I get the
Windows message saying that the virtual memory's getting really low. Plus
the machine gets really sluggish (with multi-threading). Is it possible to
use the virtual memory until it reaches a certain limit and then use...
|
by: Mike |
last post by:
List,
I call this a "Parsing Problem", but it could be called formatting or
regular expressions as well. I have a set of data that was formerly
processed on an OS390 (hence a lot of horsepower). Now, it has been
moved to a database from where I can call it via a web service with a
C# client. The data looks like this:
ABLATION ENDOMETRIAL (HYSTEROSCOPIC)
ABLATION HEART (CONDUCTION DEFECT)
|
by: Burton Wilkins |
last post by:
Dear Authorities:
I realize that in communicating with a Web Service, one is essentially
passing a string as a parameter.
Is there a limit over the Internet how long a parameter string can be? Or
can the string be of an unlimited length, and is then simply divided up into
packets?
Is there a danger of loosing data if the string being passed in a parameter
| |
by: ted benedict |
last post by:
hi everybody, i hope this is the right place to discuss this weird
behaviour. i am getting dynamically generated text or xml from the
server side using xmlhttprequest. if the server side data is STATIC, i
can have whatever size of data i want.
but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest's responseText is
truncated, and the xml therefore not well fromed. in border...
|
by: sanou |
last post by:
Hi
No doubt this question, or a similar version of it, has been asked before. But, I was looking around the forums and i couldn't find anything.
I'm using VC++ to create a simple calculator that sums the values from 2 textboxes. I wanted to implement a simple data validation that would spit out various error messages if the user typed in incorrect data.
I managed to vomit out the following code. Yes I know it's beastly,...
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
Hi all,
I am thinking about doing this since I got several cases that some of our
internal users open more than one browser at the same time from our server.
When one of the transactions was not completed finished, the second browser
jusk pick up some session variables from the first browser and process right
after that. It messed up everything.
I was thinking about use remote_addr, but it seems not working since we are
behind the...
|
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
____________________________________
| |
| ------------------ |
| | BUTTON | |
| ...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |