473,395 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MS Access data validation combo list text length restriction

Is it possible to restrict the length of a text box in MS Access using
VBA on condition to what is selected in a list combo box.

Scenario:

1. I have a list combo box containing:

AA
BBB
CCCC
DD1
HAXX
123

2. I have a empty text box called A.
3. Upon selecting a option from the list combo box, the list value
selected will be moved to text box A. In addition, depending on what is
selected and moved from the list combo box, the length of text box A
will vary.

Combo
List End Result in text box A
------------------------------------------------------------------------------------------------------------------------
AA = AA and additional 6 digits = Total 8 characters in length of
the text box A
BBB = BBB and additional 8 digits = Total 11 characters in length
of the text box A
CCCC = CCC and additional 8 digits = Total 12 characters in length
of the text box A
DD1234 = DD1234 and additional 4 digits = Total 10 characters in
length of the text box A
HAXX = HAXX and additional 7 digits = Total 11 characters in length
of the text box A
123 = 123 and additional 5 digits = Total 8 characters in length of
the text box A
Is this doable?

Many thanks in Advance.

Kind regards...

Brenda

Jul 14 '06 #1
1 2796
SDL
If all you want is the length of the resulting data just use the
Len(strName) to get the length of the string field. I believe this will
work. If you need to know where the data ends to apend the digits you
talk about you could also parse the field using string commands. I
guess the question is what are you trying to accomplish?

If you field in Text box A is called strTextBoxA try:

Dim TextBoxLen As Long
TextBoxLen = Len(strTextBoxA)

See if that varies with that data and gives you what you need.

Jul 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joyce | last post by:
The XML Schema design problem to solve is as follows: We have 2 combo boxes to populate from schema data, let's say: 1. States 2. Cities (and this one gets populated depending on the choice of...
5
by: Bob | last post by:
I have a form with controls City and Zip Code, and a Table containing Zip Code with the corresponding City. I would like the user to just enter Zip Code, either by typing or with a combo box; then...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
3
by: Raghu | last post by:
I have following schema: <?xml version="1.0" encoding="utf-8"?> <xs:schema elementFormDefault="qualified" targetNamespace="http://mycompany.services.customer2/types/restricted"...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.