Format issue ... 2 decimal places displayed?

B

BobC

I am Creating and Access 2000 form that has unbound combo boxes whose
row sources are unique queries. When I click on the arrow to select a
row source, the text box displays a number with 2 decimal places ... I
do not want that ... I want no decimal places showing. I cannot seem to
figure out what to change to eliminate the '.00'
The original table contains integer values (no decimal places).
Do I change the query?
 
J

Jeanette Cunningham

Bob,
Here is a way to find out about formatting numbers that you can use for
controls on forms as well
Open the table in design view
Select the number field
In the lower pane of the table put the cursor in the dropdown for Format and
press F1
Help will open with lots of info about formatting
Choose Number and Currency Data Types

Jeanette Cunningham
 
B

BobC

Thanks for your suggestions ...
The table was/is set to integer/0 decimal places
I do not know how to change formatting in the query; but the data view
of the query shows no decimal points.
I could not find and formating available for the row source on the form.
 
B

BobC

After I select a row source, the number in the text box does not display
any decimal places ... it is while I have my cursor on the tear drop to
select from the drop-down choices that it is displaying two decimal
places. Since one of the combo boxes is selecting from a choice of
'years' such as 2008; the drop down choices list '2008.00', it is
distracting.
 
J

Jeanette Cunningham

Bob,
to format the combo,
select the combo, on the property dialog, format tab, the first property is
format - this is where you set the format, you can use Allen's example of
format fixed, choose fixed in the format drop down. On the next line,
choose 0 for decimal places. Save the changes to your form.

Jeanette Cunningham
 
B

BobC

Jeanette,

Maybe I am incorrectly stating the problem or am misunderstanding what
you folks are trying to get across to me?
But, I believe I have done what both you and Allen have suggested. I am
thinking that the portions of the combo box properties that you are
referring to applies to the text box portion of the combo box and does
not affect the momentary displayed list of the row source during the
selection process.

I will use one of the unbound combo boxes as an example ...

The original source of the data is a field of a table containing years
(2001, 2003, 2007, 2001, etc.). Since the years are not unique; I am
using a unique query as my row source to the combo boxes.

The problem is that while I am in the process of selecting (i.e. holding
down the drop down arrow on the right side of the combo box to select
from the row source); in this example, a specific year from a list of
years; the year will display as e.g 2008.00 as one of the choices ...
until I release the cursor and the 2008 ('without decimals') shows up in
the text box portion of the combo box. The display of years with 2
decimal places seems undesirable, and thus the basis of my issue.

I have a hunch that the output of the unique query may have something to
do with this issue, but a display of the unique query output does not
show and decimal points in the years.

Sorry to be a pain on something that is possibly due to my
misunderstanding of what you are trying to convey?

Bob
 
J

Jeanette Cunningham

Bob,
I assume that you understand what we are trying to say. The fact that after
you make a selection in the combo it is formatted correctly suggests that
you applied the format to the combo box.
Would you post the sql of the row source query, how many columns the combo
has and the bound column.
I haven't found that using a distinct query causes problems like that.

Jeanette Cunningham
 
B

BobC

Jeanette,

I do not know how to get the sql of the row source query ... ?
I created the query with a query builder (ACCESS 2000)?
If there is a way ... please let me know and I will.
In properties:
Row Source is: qryNewReten(Unique Values POLYR)
Column count is 1
Column Head is NO
Bound Column is 1

Bob
 
B

BobC

Jeanette,

It's getting rather late and I have to work tomorrow ... It may be
tomorrow evening before I can get back?
In any case ... Thanks for your time and efforts!

Bob
 
J

Jeanette Cunningham

Bob,
to get sql of your query, open the query in design view, then select Query |
SQL view from the menu.
Copy and paste the sql into a post here.

Jeanette Cunningham
 
B

BobC

Jeanette,

I learned something! ... here is the SQL View:

SELECT tblNewReten.RECNO, tblNewReten.HA, tblNewReten.POLYR,
tblNewReten.PROPRET, tblNewReten.LIABRET, tblNewReten.LIABAGG,
tblNewReten.PROPAGG, tblNewReten.MHAPDED, tblNewReten.MEMDED,
tblNewReten.AUTOPHYDED, tblNewReten.TFDED, tblNewReten.EPLDED
FROM tblNewReten, tblHousingNames;
 
J

Jeanette Cunningham

Bob,
What is HA? is it a date field, text field or number field?

Jeanette Cunningham
 
B

BobC

long integer, fixed, 0 decimal ...
in actuality it is numbers in the range of 1 - 150 (duplicates ok)
 
J

Jeanette Cunningham

Bob,
I've finally been able to reproduce that format with 2 decimal places in a
combo on the form.
The thing that makes the 2 decimal places is the formatting you have applied
to the HA field in the table.
Go back to tblNewRetan and select the HA field,
--lower pane of table
--in the format property delete everything
--in the decimal places select auto
--save the changes to the table

Now open your form and you should find that the combo shows whole numbers.

Jeanette Cunningham
 
B

BobC

Jeanette,

That did it!
How in the world did you figure that out! and ...
Why would Integer cause it? ...

Bob
 
J

Jeanette Cunningham

Bob,
I just never use Fixed format for an integer or long integer. Maybe someone
else will be able to explain it.

Jeanette Cunningham
 
B

BobC

Jeanette,

Well, at least you were willing to take all that time and effort to fix
the problem ... I would never have found it!
"THANK YOU VERY MUCH"!

Bob
 
J

Jeanette Cunningham

You're very welcome.

Jeanette Cunningham

BobC said:
Jeanette,

Well, at least you were willing to take all that time and effort to fix
the problem ... I would never have found it!
"THANK YOU VERY MUCH"!

Bob
 

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