Combo box date format changes when item selected from list

R

RobGMiller

Access 2003.

The combo box format setting is dd-mmm-yyyy.
The computer short date setting is dd/mm/yy.

The combo box value is set programmatically with the content of a date
variable and it appears as dd-mmm-yyy.

The combo box rowsource is filled with a formatted list (dd-mmm-yyyy) which
is a SQL statement with an embedded format statement and the list appears
correctly.

ex: Select format(fieldname,"dd-mmm-yyy") from tablename;

When an item in the list is selected the result display in the Combo box is
dd/mm/yy. How can the result from a selection be displayed using the
dd-mmm-yyyy format?
 
D

Douglas J. Steele

Sounds as though your combo box is bound to a field in the form's underlying
recordset, so that when a value is being displayed, it's getting the form
from the underlying field, not the combo box.

To remedy, set the Format property of the combo box to dd-mmm-yyyy
 
R

RobGMiller

Thanks for the reply Doug,

The combo box is not bound to an underlying recordset. The form is only used
to select criteria used to open reports. The format field was already set to
dd-mmm-yyyy.
 
D

Douglas J. Steele

Sorry, I'm unable to replicate your problem with an unbound combo box.
 
R

RobGMiller

Thanks for trying,


I got around the issue by leaving the format property of the combo box blank
and using the resulting formatted text as a date in part of a subsequent SQL
Statement.

Thanks again.
 

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