problems with Columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The 2nd column in my combobox is numbers in a text field so i can save them
in this format "001".
Now if i have the combobox bound to the number it saves it perfectly fine in
the database (as "001").
But if I use Me!numID = Me.Column(1) it saves the number "001" as just "1".
How do I get it to save as "001"?

Thanks
 
numID would have to be text in order to keep the leading zeroes: for numeric
fields, 1 and 001 are identical.

If all you care about is how it looks, you can format the field, using 000
as the format. However, that doesn't change what's actually stored.
 
numID is a text field. But it still wont save it in the DB as 001 if I use
the column(1) code and I need it to save this way.
 
Joel:

One alternative is to use the Format function. For example:

Me!numID = Format(Me.Column(1), "000")


--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


The 2nd column in my combobox is numbers in a text field so i can save them
in this format "001".
Now if i have the combobox bound to the number it saves it perfectly fine in
the database (as "001").
But if I use Me!numID = Me.Column(1) it saves the number "001" as just "1".
How do I get it to save as "001"?

Thanks
 
Ok just found a problem with this.

For some reason Format() worked for about 1/2 of my comboboxes in the other
ones its saves a wierd # in the database thats not even on the list...

ex: Combo1 has these selections 001 002 003 004
If i select one of these it saves 001 as 01 and 002 as 21 and 003 as 31 exc..
 
Ok just found a problem with this.

For some reason Format() worked for about 1/2 of my comboboxes in the other
ones its saves a wierd # in the database thats not even on the list...

ex: Combo1 has these selections 001 002 003 004
If i select one of these it saves 001 as 01 and 002 as 21 and 003 as 31 exc..

Please post your actual code.

John W. Vinson[MVP]
 

Ask a Question

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.

Ask a Question

Back
Top