Format field in a Combo Box

  • Thread starter Thread starter SEA
  • Start date Start date
S

SEA

I have a combo box that looks up a rug number,
description, and total # of rugs on hand (inventory). My
problem is that the # of rugs displays with 2 decimal
positions. Is there any way to get it to display without
the decimal positions? It makes the numbers look like
Dollars.

Thank you,
SEA
 
If the query behind your combo box is a "saved" query (ex. qryMyComboBox)
then you can just set the format for the column in the column Properties.
For a "internal" query, I use the Val and Format function right in the query
column... (use your own names)
TotalRugs: Val(Format([RugCount],"#"))
would display only whole numbers.
hth
Al Camp
 
Thanks - it works! And I guess I learned that you can't
format in a "row Source" type query in the form, only in a
saved query, right? That must be one reason to save a
query.
Thanks
SEA
-----Original Message-----
If the query behind your combo box is a "saved" query (ex. qryMyComboBox)
then you can just set the format for the column in the column Properties.
For a "internal" query, I use the Val and Format function right in the query
column... (use your own names)
TotalRugs: Val(Format([RugCount],"#"))
would display only whole numbers.
hth
Al Camp

I have a combo box that looks up a rug number,
description, and total # of rugs on hand (inventory). My
problem is that the # of rugs displays with 2 decimal
positions. Is there any way to get it to display without
the decimal positions? It makes the numbers look like
Dollars.

Thank you,
SEA


.
 
SEA,
No...
You can use the very handy Format Property -OR- the Val/Format method in
a "saved" query.
In a "resident only" query, you'll have to use the Val/Format. At least
in Access97, whenever you put a Format in the property box, close the query,
and come back later, the Format is gone.
I think it's because a "resident only" query just stores an SQL
statement, so the formatting must be within the statement (the Val/Format).
When you "save a query" Access can store your formatting like a property.
You can control data format in either query type... but you have to use
different methods.
hth
Al Camp

SEA said:
Thanks - it works! And I guess I learned that you can't
format in a "row Source" type query in the form, only in a
saved query, right? That must be one reason to save a
query.
Thanks
SEA
-----Original Message-----
If the query behind your combo box is a "saved" query (ex. qryMyComboBox)
then you can just set the format for the column in the column Properties.
For a "internal" query, I use the Val and Format function right in the query
column... (use your own names)
TotalRugs: Val(Format([RugCount],"#"))
would display only whole numbers.
hth
Al Camp

I have a combo box that looks up a rug number,
description, and total # of rugs on hand (inventory). My
problem is that the # of rugs displays with 2 decimal
positions. Is there any way to get it to display without
the decimal positions? It makes the numbers look like
Dollars.

Thank you,
SEA


.
 
Back
Top