I don't quite understand what you mean by "ingnore strings that are not long
enough". Also, do you mean that even though the field size of the field in
the table is 30 and the length of the string in the text box is only 5, you
want to add 25 spaces to it to store it as 30 characters?
The basic concept to make a string a specific length is
x = x & space(30-len(x))
You can also control it in the text box by specifying an inputmask that
requires a specific number of characters.
Out of curiousity, though, I wonder why you want to do that. Access stores
only the actual length of the string in the table, so if the string started
out as 5 long, only 5 characters are stored in the table. Doing what you are
asking increases the size of the database by carrying around a bunch of
meaningless data. This also means that much extra data traveling on the
network.
Thanks Klatuu. What I am trying to do is control the data I have coming into
the text box from a scanner. In one instance, the text box has to be able to
accept a 16 digit, and only 16 digit, package ID (all numeric). If the
barcodes I'm scanning are mis-scanned, which happens, it only picks up half
the digits. I want to eliminate having the erroneous, shorter scans post to
my table, hence the 16 digit requirement.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.