473,884 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding a character to a Combo Box value

Heello, I'm using Access 2000. I have a form with a combo box that has
a query as its row source and it's bound to column 1. This combo box
is unbound to a record like the rest of the form fields. I get a number
ID (12345) as the value when I choose it. I use code to save my record
and I have no problem with that.

The issue comes when I need to add a character (a letter B,M, or E, to
the number selected in the combo box so instead of looking like 12345
it should be B12345. I have an after update event that takes care of
this, but I get an error that says "The valued entered isn't valid for
this field" whenever I update my combo box.

I've tried different ways to add that letter to the number chosen, but
I haven't been successful. If I change the letter to a number, lets
say 9 instead of B, the combo box does not have a problem displaying
the new value '912345'.

How can I make this combo box an alpha field instead of a numeric only
field so I can add that letter to the chosen value? I set the Limit to
List property to No and it still does not work.

Any help would be appreciated it.

Cheers.

Nov 13 '05 #1
3 2191
<IL***@NETZERO. NET> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com...
Heello, I'm using Access 2000. I have a form with a combo box that has
a query as its row source and it's bound to column 1. This combo box
is unbound to a record like the rest of the form fields. I get a number
ID (12345) as the value when I choose it. I use code to save my record
and I have no problem with that.

The issue comes when I need to add a character (a letter B,M, or E, to
the number selected in the combo box so instead of looking like 12345
it should be B12345. I have an after update event that takes care of
this, but I get an error that says "The valued entered isn't valid for
this field" whenever I update my combo box.

What is the data type of the field that your code updates?

Keith.
www.keithwilby.com
Nov 13 '05 #2

Keith wrote:
<IL***@NETZERO. NET> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com...
Heello, I'm using Access 2000. I have a form with a combo box that has
a query as its row source and it's bound to column 1. This combo box
is unbound to a record like the rest of the form fields. I get a number
ID (12345) as the value when I choose it. I use code to save my record
and I have no problem with that.

The issue comes when I need to add a character (a letter B,M, or E, to
the number selected in the combo box so instead of looking like 12345
it should be B12345. I have an after update event that takes care of
this, but I get an error that says "The valued entered isn't valid for
this field" whenever I update my combo box.

What is the data type of the field that your code updates?

Keith.
www.keithwilby.com


Hi Keith, it's an integer data type. However, I believe I just solved
this problem.

First of all, I found out I needed only 1 letter (B) not 3, so I
included it when selecting from the row source:

SELECT "B" & [theNumericID] AS Expr1 FROM [thequery];

That solved the need to alter the chosen numeric ID with an afterupdate
event. The letter gets embedded before choosing it. That's what I
needed.

Thanks for your fast response anyway.

:-)

Nov 13 '05 #3

Keith wrote:
<IL***@NETZERO. NET> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com...
Heello, I'm using Access 2000. I have a form with a combo box that has
a query as its row source and it's bound to column 1. This combo box
is unbound to a record like the rest of the form fields. I get a number
ID (12345) as the value when I choose it. I use code to save my record
and I have no problem with that.

The issue comes when I need to add a character (a letter B,M, or E, to
the number selected in the combo box so instead of looking like 12345
it should be B12345. I have an after update event that takes care of
this, but I get an error that says "The valued entered isn't valid for
this field" whenever I update my combo box.

What is the data type of the field that your code updates?

Keith.
www.keithwilby.com


Hi Keith, it's an integer data type. However, I believe I just solved
this problem.

First of all, I found out I needed only 1 letter (B) not 3, so I
included it when selecting from the row source:

SELECT "B" & [theNumericID] AS Expr1 FROM [thequery];

That solved the need to alter the chosen numeric ID with an afterupdate
event. The letter gets embedded before choosing it. That's what I
needed.

Thanks for your fast response anyway.

:-)

Nov 13 '05 #4

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

Similar topics

3
2132
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase, along with (say) the date. ATM, I have a table with (say) 4 fields. Each field is linked to a column in a combo box. The combo box is invisible on the form. The text boxes display previous data using code something like this... Private Sub...
1
1887
by: Dave | last post by:
I have a problem which I know there is an answer to but have so far been unsuccessful in finding it. It is quite simple in theory. I have created a form which uses a table for lookup values and they appear on the form as a list box. I know I can restrict to list or not within the table, but what I want to do is to be able to add to the list if the item is not there (which you can simply do by typing it into the combo box) but also update...
4
24754
by: Gav | last post by:
I am using VS 2005 and am trying to add items to a combo box using C#. I know how to add simple text items but I am trying to add a value and some text ie. Value Text A First Text B Second Text I've seen examples of ListItem but I can't seem to get this to work, can anybody offer any advice.
5
4667
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound combo by allowing the user to dynamically type in the new value directly in the combo box whcih in turn updates the lookup table and then when they have finished leaves that particular cell on the grid with the correct value. Seems...
6
2681
by: vb | last post by:
Hi, I am new to .Net. I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated 2. How do I dispose the Combo Box items.
5
1944
by: Kay | last post by:
Hi All, I'm trying to write a small sub/function to replace some (invalid) character in a combo box, or may be even text box. For example, I have several combo boxes that allows user to select a time value, i.e. 21:30, however I also want to allow them to enter a time, as a result I want to replace comma, fullstop etc with a colon ":". I've done this in VB6 keypress event, however with the "sender", "e" in .net I'm a bit lost... I...
1
2582
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box has 4 possible answers to a question. Each of the 4 possible answers is also assigned a value: answer 1 is worth 1 point, answer 2 is worth 2 points.... What I need to do now is add togethor the points of all the combo boxes. So far I have given...
1
2470
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this guy's Javascript "combo box" - http://sandy.mcarthur.org/javascript/select/select.html. It allows my users (when I get some!) to select from a list of preexisting options and also to add a new one by clicking on "add new". Essentially it's a select...
3
1843
by: =?Utf-8?B?Y2RtdW5veg==?= | last post by:
I have created a sub routine to programmatically add an indefinite number of combo boxes to a form. The combo boxes are bound in code to a view for displaying the available options. This routine works good until you add the second combo box. At that point it changes the first combo box's selected item. A third changes the second and first and so on. I've tried setting the combo box name and tag to a unique name, but that doesn't help. ...
0
9954
marktang
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...
0
9799
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10769
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 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...
1
10869
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,...
1
7985
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 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...
0
7137
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();...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4623
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
2
4231
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.