text box format

  • Thread starter Thread starter Rpettis31
  • Start date Start date
R

Rpettis31

I have set a few text box set to some values on a list box based on the user
selection. However the text box is not showing the correct format. The list
box column value is correct. The properties on the text box are set to
currency but the value in the text box does not display correctly?
 
but the value in the text box does not display correctly?
No idea what to suggest as I can not see what it is displaying.
 
The value is correct but the format is not correct the properties show as
Currency the list box value is currency yet this displays in a non currency
format.

Listbox value will show $10.89 and the text boxt will show 10.89112
 
Did you set the text box format? Formats do not carry through unless it
changes the data to text.
 
The properties of the text box are set as currency. The control source is set
up on the listbox to a column. I have tried to format the text box in code
 
Try this in the Control Source of the text box;

=CCur([lstItem].Column(2)

substituting the appropriate column number of course.

Another option would be;

=Format([lstItem].Column(2), "$##.##")
 
Correction. That should be;

=CCur([lstItem].Column(2))

(forgot the closing parentheses in my first post)
 
The control source is set up on the listbox to a column.
I am not following you.
Do you mean that the text box gets the data form a list box?
Why do you need a list box and a text box, both with the same information?
Are you picking prices or something?
Seems like just the list box would do.
 
Since the text box are not filled until the click event how do I get rid of
the #error that is prefilled in the text box?

Beetle said:
Correction. That should be;

=CCur([lstItem].Column(2))

(forgot the closing parentheses in my first post)

--
_________

Sean Bailey


Rpettis31 said:
The properties of the text box are set as currency. The control source is set
up on the listbox to a column. I have tried to format the text box in code
 
Just put the Column references directly in the Control Source
of each text box. There's no need to use the Click event at all
(at least not for this purpose).

--
_________

Sean Bailey


Rpettis31 said:
Since the text box are not filled until the click event how do I get rid of
the #error that is prefilled in the text box?

Beetle said:
Correction. That should be;

=CCur([lstItem].Column(2))

(forgot the closing parentheses in my first post)

--
_________

Sean Bailey


Rpettis31 said:
The properties of the text box are set as currency. The control source is set
up on the listbox to a column. I have tried to format the text box in code
on the list box click event to display the correct format?

:

Did you set the text box format? Formats do not carry through unless it
changes the data to text.

:

The value is correct but the format is not correct the properties show as
Currency the list box value is currency yet this displays in a non currency
format.

Listbox value will show $10.89 and the text boxt will show 10.89112

:

but the value in the text box does not display correctly?
No idea what to suggest as I can not see what it is displaying.

:

I have set a few text box set to some values on a list box based on the user
selection. However the text box is not showing the correct format. The list
box column value is correct. The properties on the text box are set to
currency but the value in the text box does not display correctly?
 
There is nothing selected on the list box when the form loads so the text box
has a #error in it. I have tried to do an nz(CCur(me.lstItems.column(3)),0)
but that does not work.

Beetle said:
Just put the Column references directly in the Control Source
of each text box. There's no need to use the Click event at all
(at least not for this purpose).

--
_________

Sean Bailey


Rpettis31 said:
Since the text box are not filled until the click event how do I get rid of
the #error that is prefilled in the text box?

Beetle said:
Correction. That should be;

=CCur([lstItem].Column(2))

(forgot the closing parentheses in my first post)

--
_________

Sean Bailey


:

The properties of the text box are set as currency. The control source is set
up on the listbox to a column. I have tried to format the text box in code
on the list box click event to display the correct format?

:

Did you set the text box format? Formats do not carry through unless it
changes the data to text.

:

The value is correct but the format is not correct the properties show as
Currency the list box value is currency yet this displays in a non currency
format.

Listbox value will show $10.89 and the text boxt will show 10.89112

:

but the value in the text box does not display correctly?
No idea what to suggest as I can not see what it is displaying.

:

I have set a few text box set to some values on a list box based on the user
selection. However the text box is not showing the correct format. The list
box column value is correct. The properties on the text box are set to
currency but the value in the text box does not display correctly?
 
You can use the forms Open event to force the first item
in the list box to be preselected.

Private Sub Form_Open (Cancel As Integer)

Me!lstItem = Me!lstItem.ItemData(0)

End Sub

Karl does bring up a good point though. Is there a reason you don't
just display all this in the list box itself?

--
_________

Sean Bailey


Rpettis31 said:
There is nothing selected on the list box when the form loads so the text box
has a #error in it. I have tried to do an nz(CCur(me.lstItems.column(3)),0)
but that does not work.

Beetle said:
Just put the Column references directly in the Control Source
of each text box. There's no need to use the Click event at all
(at least not for this purpose).

--
_________

Sean Bailey


Rpettis31 said:
Since the text box are not filled until the click event how do I get rid of
the #error that is prefilled in the text box?

:

Correction. That should be;

=CCur([lstItem].Column(2))

(forgot the closing parentheses in my first post)

--
_________

Sean Bailey


:

The properties of the text box are set as currency. The control source is set
up on the listbox to a column. I have tried to format the text box in code
on the list box click event to display the correct format?

:

Did you set the text box format? Formats do not carry through unless it
changes the data to text.

:

The value is correct but the format is not correct the properties show as
Currency the list box value is currency yet this displays in a non currency
format.

Listbox value will show $10.89 and the text boxt will show 10.89112

:

but the value in the text box does not display correctly?
No idea what to suggest as I can not see what it is displaying.

:

I have set a few text box set to some values on a list box based on the user
selection. However the text box is not showing the correct format. The list
box column value is correct. The properties on the text box are set to
currency but the value in the text box does not display correctly?
 
Back
Top