format combo box

G

Guest

In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the control
as "00 0000".

The control displays properly except when clicking into the combo box. I do
have on focus code to change color but cannot see that as an impediment to
formatting as above. What I get displayed on clicking into the box is not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00 0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to accomplish?
 
A

Arvin Meyer [MVP]

Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true number.
 
G

Guest

Thanks for the response...no help.
--
Thanks for your help,
Chris


Arvin Meyer said:
Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true number.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Chris said:
In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the
control
as "00 0000".

The control displays properly except when clicking into the combo box. I
do
have on focus code to change color but cannot see that as an impediment to
formatting as above. What I get displayed on clicking into the box is not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00 0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to accomplish?
 
G

Grover Park George

When you apply formatting to a value in a control, all you are doing is
changing the way it is displayed. You have done nothing to the actual vaue
itself. When you click into the combo box--in actual database terms, when
you give that control the focus--it will display the real, actual value, not
the formatted display. That's how it works.

--
George Hepworth
Access MVP
www.gpcdata.com


Chris said:
Thanks for the response...no help.
--
Thanks for your help,
Chris


Arvin Meyer said:
Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true
number.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Chris said:
In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the
control
as "00 0000".

The control displays properly except when clicking into the combo box.
I
do
have on focus code to change color but cannot see that as an impediment
to
formatting as above. What I get displayed on clicking into the box is
not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00 0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to accomplish?
 
G

Guest

Thanks for replying.

So, that means there is no "mask" trick? It is what it is in raw format in
any case, for any type, if its in a combo box? Is that a peculiarity of
combo box? Just something to live with?

I'll know for future, but sure would like it to be otherwise now.

--
Chris


Grover Park George said:
When you apply formatting to a value in a control, all you are doing is
changing the way it is displayed. You have done nothing to the actual vaue
itself. When you click into the combo box--in actual database terms, when
you give that control the focus--it will display the real, actual value, not
the formatted display. That's how it works.

--
George Hepworth
Access MVP
www.gpcdata.com


Chris said:
Thanks for the response...no help.
--
Thanks for your help,
Chris


Arvin Meyer said:
Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true
number.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the
control
as "00 0000".

The control displays properly except when clicking into the combo box.
I
do
have on focus code to change color but cannot see that as an impediment
to
formatting as above. What I get displayed on clicking into the box is
not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00 0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to accomplish?
 
A

Arvin Meyer [MVP]

In your example, the "number" is: 07 2358

07 2358 is not a number, it is text containing numerals. There is no such
thing as a base 10 number beginning with a zero except for a zero (0). You
can change the field's datatype to text, and get it to work, but then you
cannot use it as a number. Text cannot be calculated.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Chris said:
Thanks for replying.

So, that means there is no "mask" trick? It is what it is in raw format
in
any case, for any type, if its in a combo box? Is that a peculiarity of
combo box? Just something to live with?

I'll know for future, but sure would like it to be otherwise now.

--
Chris


Grover Park George said:
When you apply formatting to a value in a control, all you are doing is
changing the way it is displayed. You have done nothing to the actual
vaue
itself. When you click into the combo box--in actual database terms, when
you give that control the focus--it will display the real, actual value,
not
the formatted display. That's how it works.

--
George Hepworth
Access MVP
www.gpcdata.com


Chris said:
Thanks for the response...no help.
--
Thanks for your help,
Chris


:

Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true
number.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the
control
as "00 0000".

The control displays properly except when clicking into the combo
box.
I
do
have on focus code to change color but cannot see that as an
impediment
to
formatting as above. What I get displayed on clicking into the box
is
not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00
0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to
accomplish?
 
G

Guest

Thanks. I made a covering control (all but the box's pull-down arrow) to
show the user the correct format while allowing them to select properly.
This works fine, its a workaround, but does work form me.
--
Thanks for your help,
Chris


Arvin Meyer said:
In your example, the "number" is: 07 2358

07 2358 is not a number, it is text containing numerals. There is no such
thing as a base 10 number beginning with a zero except for a zero (0). You
can change the field's datatype to text, and get it to work, but then you
cannot use it as a number. Text cannot be calculated.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Chris said:
Thanks for replying.

So, that means there is no "mask" trick? It is what it is in raw format
in
any case, for any type, if its in a combo box? Is that a peculiarity of
combo box? Just something to live with?

I'll know for future, but sure would like it to be otherwise now.

--
Chris


Grover Park George said:
When you apply formatting to a value in a control, all you are doing is
changing the way it is displayed. You have done nothing to the actual
vaue
itself. When you click into the combo box--in actual database terms, when
you give that control the focus--it will display the real, actual value,
not
the formatted display. That's how it works.

--
George Hepworth
Access MVP
www.gpcdata.com


Thanks for the response...no help.
--
Thanks for your help,
Chris


:

Although you display the currency as 07 2358, that is not a format for
currency and when cllicking into the control, you get only the true
number.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

In hopes someone can shed some light . . .

A field is currency type in the table and formatted there and in the
control
as "00 0000".

The control displays properly except when clicking into the combo
box.
I
do
have on focus code to change color but cannot see that as an
impediment
to
formatting as above. What I get displayed on clicking into the box
is
not
"07 2358" but "72358".

Research indicated the following code, but it won't work for me.

Forms![frm1 Client].Form![Jobfrm].Form![cboFindJob].Format = "00
0000"

As you can see, the control is on a subform.

Can someone see something wrong in my code -- or ability to
accomplish?
 

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