Formatting multiple columns in a combo box

D

DubboPete

Hi all,

Is it possible to change the formatting of a third column in a 4-
column combo box from 20051965 to 20/05/1965, just to make recognition
easier?

20051965 is a date value, and any format to make it easier to read
would help, ie, could be 20-05-1965, 20/05/1965, or even 20-May-1965!

tia

DubboPete
 
D

Damon Heron

If the third column is a date value from a table then design the table
format as shortdate, for instance, and give it an input mask.

HTH
Damon
 
A

Allen Browne

In the RowSource of the combo, specify the format you want.

From your example, I take it that the field is a Number (Long Integer).
So instead of:
SELECT F1, F2, F3 FROM Table1;
you would use:
SELECT F1, F2, Format([F3], "00\/00\/0000") AS FakeDate FROM Table1;

If you want the month name, use Left(), Mid(), Right() to parse the parts,
DateSerial() to create the date, and then Format() with "Medium Date".
 
D

DubboPete

In the RowSource of the combo, specify the format you want.

From your example, I take it that the field is a Number (Long Integer).
So instead of:
SELECT F1, F2, F3 FROM Table1;
you would use:
SELECT F1, F2, Format([F3], "00\/00\/0000") AS FakeDate FROM Table1;

If you want the month name, use Left(), Mid(), Right() to parse the parts,
DateSerial() to create the date, and then Format() with "Medium Date".

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.






Is it possible to change the formatting of a third column in a 4-
column combo box from 20051965 to 20/05/1965, just to make recognition
easier?
20051965 is a date value, and any format to make it easier to read
would help, ie, could be 20-05-1965, 20/05/1965, or even 20-May-1965!

DubboPete- Hide quoted text -

- Show quoted text -

Hi Allen,

The formatting works, as in 00/00/0000, however, it screws up the
year! Looks like it's displaying julien as opposed to actual - for
instance I'm getting dates such as 25/01/7124!

Any clues how to fix that snappy little sucker?

Pete
 
D

DubboPete

If the third column is a date value from a table then design the table
format as shortdate, for instance, and give it an input mask.

HTH
Damon








- Show quoted text -

Thanks Damon, but I don't have rights to alter the table structure
(which is ok with me), so coding has to be the way to go

cheers
Pete
 
Top