By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,263 Members | 2,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,263 IT Pros & Developers. It's quick & easy.

datediff function and access database

P: n/a
Can some one show me how to use the datediff function where the dates
are being supplied through an access db. For instance, a recordset
would contain these fields: DateAssigned, DateDue, ProjectName,
ProjectDetail, Class. The student enters a project name, then a date
it was assigned and a date it is due...and other details about the
project into the appropriate fields. The projects appear in a
databound list box...when you click on a project name in the list box
I want the student to see automatically (in a label) how many days are
left until that project is due and so forth as they scroll down the
list box projects. I'm a newbe and would appreciate some help. Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Well, you can't do it directly in a label. To use a label, you would have to
do this in VBA code and change the Caption value of the label. What would
work better would be a textbox. You could format it to look like a label, if
you wish, and set its Locked property to Yes to keep the user from
attempting to edit it. You could then use an equation similar to the
following:

="There are " & DateDiff("d", Date, [DateDue]) & " day(s) left until this
project is due."

The [DateDue] is the name of the field. You can also refer to the name of
the textbox that displays the [DateDue] field. You will need to make the
textbox have a different name than the field it is bound to. For example, if
the field name is [DateDue] then try naming the textbox txtDateDue.

--
Wayne Morgan
MS Access MVP
<in**@ceramcoceramics.com> wrote in message
news:41**************@news.alt.net...
Can some one show me how to use the datediff function where the dates
are being supplied through an access db. For instance, a recordset
would contain these fields: DateAssigned, DateDue, ProjectName,
ProjectDetail, Class. The student enters a project name, then a date
it was assigned and a date it is due...and other details about the
project into the appropriate fields. The projects appear in a
databound list box...when you click on a project name in the list box
I want the student to see automatically (in a label) how many days are
left until that project is due and so forth as they scroll down the
list box projects. I'm a newbe and would appreciate some help. Thanks

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.