Integer displaying with two decimals!

  • Thread starter Laurel Eppstein
  • Start date
L

Laurel Eppstein

Access 2003

I have a very puzzling problem. In my underlying table, I have an
integer field, "TSPyear". On my form, I have created a combobox which
queries that table and displays each year that has been entered, using a
Totals SQL.

When viewing the output of the SQL in design view, the year displays
correctly, with no decimals. Yet when one clicks on the combobox in
form view, the years display as such:

2003.00
2004.00
2005.00

What the..?? If I try to force no zeroes in the box, by setting the
properties of the field in the SQL to "fixed, 0 decimals", no change.
And when I go back into the SQL, I find that the format I had just set
and saved is gone!!

Is this a bug in Access 2003???? It's driving me NUTS!!!

Thanks, all,
Laurel
 
S

Steve Schapel

Laurel,

I am not sure what you mean by "Totals SQL". But anyway, try setting
the Row Source of the combobox to:
SELECT DISTINCT [TSPyear] FROM NameOfYourTable
.... and set the Format property of the combobox to General Number.
 
L

Laurel Eppstein

Steve, thanks for your reply. What I meant by "Totals" was that I was
using a group-by query, and the rowource of the combobox was this SQL
query. Is there a way to set the format property within the SQL
statement itself? Because when I do it using the property sheet of the
query, it doesn't take. I have done what you suggested, and the two
zeroes still display after the decimal. Weird, huh? I'm so frustrated
with this!

Laurel
 
J

John Vinson

Steve, thanks for your reply. What I meant by "Totals" was that I was
using a group-by query, and the rowource of the combobox was this SQL
query. Is there a way to set the format property within the SQL
statement itself? Because when I do it using the property sheet of the
query, it doesn't take. I have done what you suggested, and the two
zeroes still display after the decimal. Weird, huh? I'm so frustrated
with this!

Try setting the format property *of the combo box itself* to #.
 
L

Laurel Eppstein

John, thanks for putting in your idea. Still doesn't work! -Laurel

(I'm leaving for the day, but any more ideas will be gratefully reviewed
tomorrow!)
 

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

Top