automate a boolean operation with a calculation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to automate a control by anyway possible. I have a yes/no
boolean for a field called 'UpToDate'. I'm thinking that a form is the place
to handle this because, I can have a bound box that is not visible that
calculates the month difference and compares to 'updateFrequency'....

My idea is:

when the "month" difference between Date() and 'CourseDate' >
'updateFrequency' then 'upToDate' = 0

and viceversa

Some help would be appreciated, thank you.
 
I'm not sure that I fully understood the requirement, but try playing around
with something like this in the ControlSource property of a check box ...

=Not (DateDiff('d',[txtCourseDate],Date())>[txtUpdateFrequency])

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
that wasn't "exactly" what i was looking for, BUT you pushed me in a
direction where I solved my problem....thank you

Brendan Reynolds said:
I'm not sure that I fully understood the requirement, but try playing around
with something like this in the ControlSource property of a check box ...

=Not (DateDiff('d',[txtCourseDate],Date())>[txtUpdateFrequency])

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


scottywaty said:
I am trying to automate a control by anyway possible. I have a yes/no
boolean for a field called 'UpToDate'. I'm thinking that a form is the
place
to handle this because, I can have a bound box that is not visible that
calculates the month difference and compares to 'updateFrequency'....

My idea is:

when the "month" difference between Date() and 'CourseDate' >
'updateFrequency' then 'upToDate' = 0

and viceversa

Some help would be appreciated, thank you.
 
I have it working for a form, but I really need to figure something out to
apply a calculation in a table. He is a more detailed description of what I
have/need.

I am creating a Training Database, it keeps track of courses/employees and
also populates who needs which courses depending on several different
factors. The one that i'm trying to deal with is "when a course is out of
date and needs to be given again, a report is created with the course info
and the employees who need to attend.

When the months between 'today's date' and 'course date' (a seperate record
is created by: course name / date / time), is greater than the 'update
frequency' (which is a number that is specific to each course, example the
course is good for 18 months, before that course needs to be repeated)

here is where the fields are located:

!TblCourseOffered.[CourseDate] (this is the 'many' side, since 1 class can
have many dates)

!TblCourses.[blnUpdateFreq] (this is where course details are found, the
'one' side)

so, I need something to the affect
=not (datediff('mm',[CourseDate],date())>!TblCourses.[blnUpdateFreq]

but...where can i handle this type of calculation in a table?? is this
something I could have run @ startup??

I'm looking for suggestions, hopefully I gave a better idea of what i'm
trying to accomplish

I solved the problem at the form level, but that is not where this needs to
be driven from, it needs to be at the table or query level.

Thanks....


scottywaty said:
that wasn't "exactly" what i was looking for, BUT you pushed me in a
direction where I solved my problem....thank you

Brendan Reynolds said:
I'm not sure that I fully understood the requirement, but try playing around
with something like this in the ControlSource property of a check box ...

=Not (DateDiff('d',[txtCourseDate],Date())>[txtUpdateFrequency])

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


scottywaty said:
I am trying to automate a control by anyway possible. I have a yes/no
boolean for a field called 'UpToDate'. I'm thinking that a form is the
place
to handle this because, I can have a bound box that is not visible that
calculates the month difference and compares to 'updateFrequency'....

My idea is:

when the "month" difference between Date() and 'CourseDate' >
'updateFrequency' then 'upToDate' = 0

and viceversa

Some help would be appreciated, thank you.
 
You can't do it in a table, but you can do it in a query, and you can use a
query just about anywhere you can use a table. In a query, it would look
something like this (in the query design view) ...

UpToDate: Not (DateDiff('mm',[CourseDate],Date())>[UpdateFreq]

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


scottywaty said:
I have it working for a form, but I really need to figure something out to
apply a calculation in a table. He is a more detailed description of what
I
have/need.

I am creating a Training Database, it keeps track of courses/employees and
also populates who needs which courses depending on several different
factors. The one that i'm trying to deal with is "when a course is out of
date and needs to be given again, a report is created with the course info
and the employees who need to attend.

When the months between 'today's date' and 'course date' (a seperate
record
is created by: course name / date / time), is greater than the 'update
frequency' (which is a number that is specific to each course, example the
course is good for 18 months, before that course needs to be repeated)

here is where the fields are located:

!TblCourseOffered.[CourseDate] (this is the 'many' side, since 1 class can
have many dates)

!TblCourses.[blnUpdateFreq] (this is where course details are found, the
'one' side)

so, I need something to the affect
=not (datediff('mm',[CourseDate],date())>!TblCourses.[blnUpdateFreq]

but...where can i handle this type of calculation in a table?? is this
something I could have run @ startup??

I'm looking for suggestions, hopefully I gave a better idea of what i'm
trying to accomplish

I solved the problem at the form level, but that is not where this needs
to
be driven from, it needs to be at the table or query level.

Thanks....


scottywaty said:
that wasn't "exactly" what i was looking for, BUT you pushed me in a
direction where I solved my problem....thank you

Brendan Reynolds said:
I'm not sure that I fully understood the requirement, but try playing
around
with something like this in the ControlSource property of a check box
...

=Not (DateDiff('d',[txtCourseDate],Date())>[txtUpdateFrequency])

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible
for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with
a
GlobalSign digital certificate is a forgery and should be deleted
without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


I am trying to automate a control by anyway possible. I have a yes/no
boolean for a field called 'UpToDate'. I'm thinking that a form is
the
place
to handle this because, I can have a bound box that is not visible
that
calculates the month difference and compares to 'updateFrequency'....

My idea is:

when the "month" difference between Date() and 'CourseDate' >
'updateFrequency' then 'upToDate' = 0

and viceversa

Some help would be appreciated, thank you.
 
Back
Top