Decimal places in combo box

D

Dave C.

I have a table with project numbers in the format ######.### In the table,
the format for the job number is set to "double", "3" decimal places and
displays correctly in the table view.

Why when I create a combo box with "Project Number" and "Project Name" does
it default to 2 decimal places? I've looked everywhere and cannot find how
to get it to display correctly. I would think that if the table is set to
three decimals, the combo box would default to the format of the table.

Thanks,
 
M

Mark M

If you're basing your combo box on a query, try formatting the project
number field there and see if it displays correctly in the combo box.
 
A

Al Camp

Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp
 
D

Dave C.

I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3, JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero decimals
displayed in the box, and three decimals displayed in the drop down list.
Where do I add the formatting for the display box at the top?

Thanks for the help
 
A

Al Camp

Dave,
I'm afraid I don't understand.
#.000 = forces the display to 3 places even if 0s (ex. 1.000, 5.200...
etc)
#.### = drop the 0s but show 3 places if there are values to 3 places.
(ex. 1.23, 4.1, 5.614, etc..)

Is this your query behind the combo box?
SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3, JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

If so, does the Job# column in the combo display 3 decimal places the way
you want.
If not, give examples of what you see and examples of what you want to
see.

I don't understand this...
Where do I add the formatting for the display box at the top?

Pretty sure we can fix this... just provide a clear "what I have" vs.
"what I want"
hth
Al Camp


Dave C. said:
I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3, JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero decimals
displayed in the box, and three decimals displayed in the drop down list.
Where do I add the formatting for the display box at the top?

Thanks for the help


Al Camp said:
Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp
 
A

Al Camp

Dave,
I've run into some query problems where there was formatting set up in
the table design. I never use table formatting for numbers except for Type.
Just for this problem, why don't you remove the table default formatting
, and we'll just "do it on the fly."


Are you happy withe the way the Job# column displays in the combo "drop
down listing"?

OK, now the field itself...
What is the formatting in the combo field?
If you like the 3 dec display in the combo "drop down", then the actual
combo field should be Format = #.000 DecPlaces = 3.
hth
Al Camp


Dave C. said:
Maybe it could have something to do with my "AfterUpdate"

Private Sub Find_Job_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[JOB #] = " & Me![Find Job] & ""
Me.Bookmark = rs.Bookmark
End Sub

I've attached a small jpg file that shows how the display changes after
selecting from the list. Notice the box at the top of the list now has no
decimal places, but the dropdown list shows three?

Thanks for the input though!




Al Camp said:
Dave,
I'm afraid I don't understand.
#.000 = forces the display to 3 places even if 0s (ex. 1.000, 5.200...
etc)
#.### = drop the 0s but show 3 places if there are values to 3 places.
(ex. 1.23, 4.1, 5.614, etc..)

Is this your query behind the combo box?
SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3, JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

If so, does the Job# column in the combo display 3 decimal places the
way
you want.
If not, give examples of what you see and examples of what you want to
see.

I don't understand this...
Where do I add the formatting for the display box at the top?

Pretty sure we can fix this... just provide a clear "what I have" vs.
"what I want"
hth
Al Camp


Dave C. said:
I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3, JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero
decimals
displayed in the box, and three decimals displayed in the drop down
list.
Where do I add the formatting for the display box at the top?

Thanks for the help


Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save
query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp

I have a table with project numbers in the format ######.### In the
table, the format for the job number is set to "double", "3" decimal
places and displays correctly in the table view.

Why when I create a combo box with "Project Number" and "Project Name"
does it default to 2 decimal places? I've looked everywhere and
cannot
find how to get it to display correctly. I would think that if the
table is set to three decimals, the combo box would default to the
format of the table.

Thanks,
 
D

Dave C.

I'll give this a try. Part of my problem is that I don't really know "SQL"
or "VB". Is "double" OK for the "field size" in the table? I'm not really
sure where to put the format in the "actual combo field" and I've had
problems finding an example that I understand.

Thanks for the help!


Al Camp said:
Dave,
I've run into some query problems where there was formatting set up in
the table design. I never use table formatting for numbers except for
Type.
Just for this problem, why don't you remove the table default formatting
, and we'll just "do it on the fly."


Are you happy withe the way the Job# column displays in the combo "drop
down listing"?

OK, now the field itself...
What is the formatting in the combo field?
If you like the 3 dec display in the combo "drop down", then the actual
combo field should be Format = #.000 DecPlaces = 3.
hth
Al Camp


Dave C. said:
Maybe it could have something to do with my "AfterUpdate"

Private Sub Find_Job_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[JOB #] = " & Me![Find Job] & ""
Me.Bookmark = rs.Bookmark
End Sub

I've attached a small jpg file that shows how the display changes after
selecting from the list. Notice the box at the top of the list now has
no decimal places, but the dropdown list shows three?

Thanks for the input though!




Al Camp said:
Dave,
I'm afraid I don't understand.
#.000 = forces the display to 3 places even if 0s (ex. 1.000, 5.200...
etc)
#.### = drop the 0s but show 3 places if there are values to 3 places.
(ex. 1.23, 4.1, 5.614, etc..)

Is this your query behind the combo box?
SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

If so, does the Job# column in the combo display 3 decimal places the
way
you want.
If not, give examples of what you see and examples of what you want to
see.

I don't understand this...
Where do I add the formatting for the display box at the top?

Pretty sure we can fix this... just provide a clear "what I have" vs.
"what I want"
hth
Al Camp


I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero
decimals
displayed in the box, and three decimals displayed in the drop down
list.
Where do I add the formatting for the display box at the top?

Thanks for the help


Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save
query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp

I have a table with project numbers in the format ######.### In the
table, the format for the job number is set to "double", "3" decimal
places and displays correctly in the table view.

Why when I create a combo box with "Project Number" and "Project
Name"
does it default to 2 decimal places? I've looked everywhere and
cannot
find how to get it to display correctly. I would think that if the
table is set to three decimals, the combo box would default to the
format of the table.

Thanks,
 
D

Dave C.

Al,

Your suggestion did the trick! Man, I've been beating my head against a
wall for longer than I would like to admit. I would have never thought to
change the table format. I don't have the combo box set for a "fixed"
decimal right now, but everything works! I set the table to "double"
"general number" and decimals at "auto". I also set the combo box to the
same. Now if the job number does have a point number (99058.112) it shows
up in the list correctly, and in the combo box. My form navigates correctly
to the job, and when I come back to the combo box, the index is in the right
place.

Part of the problem was that with my formatting, the combo box didn't treat
(99058) the same as (99058.000). It didn't match the display in the combo
box, so the drop down list would default to the beginning of the list, which
was really a pain with over 4,000 projects in the list!

Thanks again for your help!
Dave C.


Dave C. said:
I'll give this a try. Part of my problem is that I don't really know
"SQL" or "VB". Is "double" OK for the "field size" in the table? I'm not
really sure where to put the format in the "actual combo field" and I've
had problems finding an example that I understand.

Thanks for the help!


Al Camp said:
Dave,
I've run into some query problems where there was formatting set up in
the table design. I never use table formatting for numbers except for
Type.
Just for this problem, why don't you remove the table default
formatting , and we'll just "do it on the fly."


Are you happy withe the way the Job# column displays in the combo "drop
down listing"?

OK, now the field itself...
What is the formatting in the combo field?
If you like the 3 dec display in the combo "drop down", then the actual
combo field should be Format = #.000 DecPlaces = 3.
hth
Al Camp


Dave C. said:
Maybe it could have something to do with my "AfterUpdate"

Private Sub Find_Job_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[JOB #] = " & Me![Find Job] & ""
Me.Bookmark = rs.Bookmark
End Sub

I've attached a small jpg file that shows how the display changes after
selecting from the list. Notice the box at the top of the list now has
no decimal places, but the dropdown list shows three?

Thanks for the input though!




Dave,
I'm afraid I don't understand.
#.000 = forces the display to 3 places even if 0s (ex. 1.000,
5.200...
etc)
#.### = drop the 0s but show 3 places if there are values to 3
places.
(ex. 1.23, 4.1, 5.614, etc..)

Is this your query behind the combo box?
SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

If so, does the Job# column in the combo display 3 decimal places the
way
you want.
If not, give examples of what you see and examples of what you want
to
see.

I don't understand this...
Where do I add the formatting for the display box at the top?

Pretty sure we can fix this... just provide a clear "what I have" vs.
"what I want"
hth
Al Camp


I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero
decimals
displayed in the box, and three decimals displayed in the drop down
list.
Where do I add the formatting for the display box at the top?

Thanks for the help


Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save
query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp

I have a table with project numbers in the format ######.### In the
table, the format for the job number is set to "double", "3" decimal
places and displays correctly in the table view.

Why when I create a combo box with "Project Number" and "Project
Name"
does it default to 2 decimal places? I've looked everywhere and
cannot
find how to get it to display correctly. I would think that if the
table is set to three decimals, the combo box would default to the
format of the table.

Thanks,
 
A

Al Camp

Good Deal Dave,
Al Camp

Dave C. said:
Al,

Your suggestion did the trick! Man, I've been beating my head against a
wall for longer than I would like to admit. I would have never thought to
change the table format. I don't have the combo box set for a "fixed"
decimal right now, but everything works! I set the table to "double"
"general number" and decimals at "auto". I also set the combo box to the
same. Now if the job number does have a point number (99058.112) it shows
up in the list correctly, and in the combo box. My form navigates
correctly to the job, and when I come back to the combo box, the index is
in the right place.

Part of the problem was that with my formatting, the combo box didn't
treat (99058) the same as (99058.000). It didn't match the display in the
combo box, so the drop down list would default to the beginning of the
list, which was really a pain with over 4,000 projects in the list!

Thanks again for your help!
Dave C.


Dave C. said:
I'll give this a try. Part of my problem is that I don't really know
"SQL" or "VB". Is "double" OK for the "field size" in the table? I'm
not really sure where to put the format in the "actual combo field" and
I've had problems finding an example that I understand.

Thanks for the help!


Al Camp said:
Dave,
I've run into some query problems where there was formatting set up in
the table design. I never use table formatting for numbers except for
Type.
Just for this problem, why don't you remove the table default
formatting , and we'll just "do it on the fly."


Are you happy withe the way the Job# column displays in the combo
"drop down listing"?

OK, now the field itself...
What is the formatting in the combo field?
If you like the 3 dec display in the combo "drop down", then the
actual combo field should be Format = #.000 DecPlaces = 3.
hth
Al Camp


Maybe it could have something to do with my "AfterUpdate"

Private Sub Find_Job_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[JOB #] = " & Me![Find Job] & ""
Me.Bookmark = rs.Bookmark
End Sub

I've attached a small jpg file that shows how the display changes after
selecting from the list. Notice the box at the top of the list now has
no decimal places, but the dropdown list shows three?

Thanks for the input though!




Dave,
I'm afraid I don't understand.
#.000 = forces the display to 3 places even if 0s (ex. 1.000,
5.200...
etc)
#.### = drop the 0s but show 3 places if there are values to 3
places.
(ex. 1.23, 4.1, 5.614, etc..)

Is this your query behind the combo box?
SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

If so, does the Job# column in the combo display 3 decimal places
the way
you want.
If not, give examples of what you see and examples of what you want
to
see.

I don't understand this...
Where do I add the formatting for the display box at the top?

Pretty sure we can fix this... just provide a clear "what I have"
vs.
"what I want"
hth
Al Camp


I got part of it to work...

SELECT Format(JobNumber.[JOB #]," 0.000;-0.000") AS Fix3,
JobNumber.[JOB
NAME] FROM JobNumber ORDER BY JobNumber.[JOB #] DESC;

But I'm just not getting the "format" thing. Now there are zero
decimals
displayed in the box, and three decimals displayed in the drop down
list.
Where do I add the formatting for the display box at the top?

Thanks for the help


Dave,
A few things to try...
A ####.000 format in your table definition.
or
Save your combo query. I find that "virtual" queries don't save
query
formatting.
or
Try creating a field in your query...
FProjectNimber : Val(Format(ProjectNumber,"#.000"))
hth
Al camp

I have a table with project numbers in the format ######.### In the
table, the format for the job number is set to "double", "3" decimal
places and displays correctly in the table view.

Why when I create a combo box with "Project Number" and "Project
Name"
does it default to 2 decimal places? I've looked everywhere and
cannot
find how to get it to display correctly. I would think that if the
table is set to three decimals, the combo box would default to the
format of the table.

Thanks,
 

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