Date Calc Problem

C

Chaster

I am having serveral problems with working with date values that are in
colums of comboboxes.

The 1st is that if I have a txtbox thats properties are set to
=[cboSelectShow].[Column](2) and want to set the format to Long Date it just
displays the short date value. IE: column2 = 7/22/03 in the combo should
display Tuesday July 22, 2003 in my text box but displays 07/22/2003
instead.

I am now having problems with this calculation from that combobox so am
wondering if there is something about the value coming from a cbo that I am
missing?

=Date()-[cboSelectShow].[Column](2) 'just the standard error message shows
in the control

All values in the table where this data is being pulled from are date/time
fields.

*** I don't know if this would have anything to do with it but i normally
change the format mask to 99/99/00;0;_ instead of
99/99/0000;0;_ so that we don't have to enter 2003 but just 03 when
inserting dates.

Any help is appreciated.
 
J

John Vinson

I am having serveral problems with working with date values that are in
colums of comboboxes.

The basic problem is that the Column property of a Combo box is a Text
String, not any other type of data. Try using

Format(CDate([comboboxname].Column(2)), "Long Date")

or just use CDate to cast the value as a Date/Time and use the result
for calculations.
 

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