469,904 Members | 2,053 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

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 2006
<IL***@NETZERO.NET> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.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*********************@g49g2000cwa.googlegro ups.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*********************@g49g2000cwa.googlegro ups.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Aaron Ackerman | last post: by
6 posts views Thread by vb | last post: by
1 post views Thread by The Eclectic Electric | last post: by
3 posts views Thread by =?Utf-8?B?Y2RtdW5veg==?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.