How to create a Yes/No module based on dates

G

GrandAdmiral

I want to create a module that will tell me if the date entered in one field
is before a date that is entered into another.

Example: A client has until 02/22/2005 to turn in a payment (entered into
Due Date field). The payment is received on 02/24/2005 (entered into Payment
Received field). This would result in the module marking "No" in the On Time
field.

Can anyone assist with this or did I post to the wrong community?
 
M

Marshall Barton

GrandAdmiral said:
I want to create a module that will tell me if the date entered in one field
is before a date that is entered into another.

Example: A client has until 02/22/2005 to turn in a payment (entered into
Due Date field). The payment is received on 02/24/2005 (entered into Payment
Received field). This would result in the module marking "No" in the On Time
field.


Your question is in the right group, but I don't see a need
for a module. The OnTime text box can just use an
expression to do that:

=IIf(DueDate < PaymentReceived, "No", "Yes")
 
G

GrandAdmiral

How do you set this up? This is my first time dealing with this. Also, can
the box be configured for as cetain timeframe? Ex. Was the payment made 30
days before the Due Date?
 
G

GrandAdmiral

How do you set this up? This is my first time dealing with this. Also, can
the box be configured for as cetain timeframe? Ex. Was the payment made 30
days before the Due Date?
 
M

Marshall Barton

Just use the expression I posted earlier in the text box's
ControlSource property.

As for adding conditions, you can check for multiple
conditions in the IIf function in various ways (including
nesting one IIf inside another. You never said how you want
the due date to relate to the Yes or No, but heres one way:

=IIf(DueDate < PaymentReceived, "No", IIf(DueDate <
PaymentReceived + 30, "Early", "Yes")
 
G

GrandAdmiral

Sorry it's been a while since I posted regarding my success with this, but
here's my next question. I want to have this calculation housed in a query
design. It's not allowing me to use the initial formula.

Thanks again.

Marshall Barton said:
Just use the expression I posted earlier in the text box's
ControlSource property.

As for adding conditions, you can check for multiple
conditions in the IIf function in various ways (including
nesting one IIf inside another. You never said how you want
the due date to relate to the Yes or No, but heres one way:

=IIf(DueDate < PaymentReceived, "No", IIf(DueDate <
PaymentReceived + 30, "Early", "Yes")
--
Marsh
MVP [MS Access]


How do you set this up? This is my first time dealing with this. Also, can
the box be configured for as cetain timeframe? Ex. Was the payment made 30
days before the Due Date?
 
G

GrandAdmiral

Forget it. Answered my own question. I figured it out.

GrandAdmiral said:
Sorry it's been a while since I posted regarding my success with this, but
here's my next question. I want to have this calculation housed in a query
design. It's not allowing me to use the initial formula.

Thanks again.

Marshall Barton said:
Just use the expression I posted earlier in the text box's
ControlSource property.

As for adding conditions, you can check for multiple
conditions in the IIf function in various ways (including
nesting one IIf inside another. You never said how you want
the due date to relate to the Yes or No, but heres one way:

=IIf(DueDate < PaymentReceived, "No", IIf(DueDate <
PaymentReceived + 30, "Early", "Yes")
--
Marsh
MVP [MS Access]


How do you set this up? This is my first time dealing with this. Also, can
the box be configured for as cetain timeframe? Ex. Was the payment made 30
days before the Due Date?


GrandAdmiral wrote:
I want to create a module that will tell me if the date entered in one field
is before a date that is entered into another.

Example: A client has until 02/22/2005 to turn in a payment (entered into
Due Date field). The payment is received on 02/24/2005 (entered into Payment
Received field). This would result in the module marking "No" in the On Time
field.


:
Your question is in the right group, but I don't see a need
for a module. The OnTime text box can just use an
expression to do that:

=IIf(DueDate < PaymentReceived, "No", "Yes")
 
Top