Form Check box True or False if a condition is met.

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

Guest

I am working on a few things and functions for my current form. I currently
have the following fields on the form. Associate Name, Issue Date, Expiration
Date (filled in based on [Issue Date] +30) and a check box. I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration. I would like to have the check box
show checked after the form opens and macro runs for the records that meet
the same criteria as before. I have been stumped so far and haven't been able
to get the result I am looking for. Any help will greatly be appreciated.

Thanks,
Cory
 
"I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration."

This logic seems all wrong to me. Surely that means its NOT past its
expiration.

-Dorian
 
Your statement is correct. I must have typed in the equation backwards on my
post. It is actually Date()>=expiration date.

mscertified said:
"I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration."

This logic seems all wrong to me. Surely that means its NOT past its
expiration.

-Dorian

Cory said:
I am working on a few things and functions for my current form. I currently
have the following fields on the form. Associate Name, Issue Date, Expiration
Date (filled in based on [Issue Date] +30) and a check box. I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration. I would like to have the check box
show checked after the form opens and macro runs for the records that meet
the same criteria as before. I have been stumped so far and haven't been able
to get the result I am looking for. Any help will greatly be appreciated.

Thanks,
Cory
 
I am working on a few things and functions for my current form. I currently
have the following fields on the form. Associate Name, Issue Date, Expiration
Date (filled in based on [Issue Date] +30) and a check box. I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration. I would like to have the check box
show checked after the form opens and macro runs for the records that meet
the same criteria as before. I have been stumped so far and haven't been able
to get the result I am looking for. Any help will greatly be appreciated.

Thanks,
Cory

Using Access 2000 or newer?

1) Your database needs re-structuring.
If your [Expiration Date] is derived from [Issue Date]+30, you do NOT
need the [Expiration Date] field at all, nor do you need that [Check
Box] field.

2) Using just the [Issue Date] field, you can use Conditional
Formatting.
Set Condition1 to
Expression Is
Set the expression to:
[Issue Date]<=Date() (Notice it's less than, not greater than.
Set the Back and fore color to whatever color you think is appropriate
(Yellow on Red?).

3) You would use the same expression whenever you want to filter
records or otherwise view them as a group.

In the form's Load event:
Me.Filter = "[Issue Date] + 30 <= Date()"
Me!FilterOn = True

To preview/print a report:
DoCmd.OpenReport "ReportName", acViewPreview, , "[Issue Date] + 30 <=
Date()"
 
Thanks for your Help.

fredg said:
I am working on a few things and functions for my current form. I currently
have the following fields on the form. Associate Name, Issue Date, Expiration
Date (filled in based on [Issue Date] +30) and a check box. I have a macro
that will open a message box if the expiration date is >= Date() to notify
that a record is past it's expiration. I would like to have the check box
show checked after the form opens and macro runs for the records that meet
the same criteria as before. I have been stumped so far and haven't been able
to get the result I am looking for. Any help will greatly be appreciated.

Thanks,
Cory

Using Access 2000 or newer?

1) Your database needs re-structuring.
If your [Expiration Date] is derived from [Issue Date]+30, you do NOT
need the [Expiration Date] field at all, nor do you need that [Check
Box] field.

2) Using just the [Issue Date] field, you can use Conditional
Formatting.
Set Condition1 to
Expression Is
Set the expression to:
[Issue Date]<=Date() (Notice it's less than, not greater than.
Set the Back and fore color to whatever color you think is appropriate
(Yellow on Red?).

3) You would use the same expression whenever you want to filter
records or otherwise view them as a group.

In the form's Load event:
Me.Filter = "[Issue Date] + 30 <= Date()"
Me!FilterOn = True

To preview/print a report:
DoCmd.OpenReport "ReportName", acViewPreview, , "[Issue Date] + 30 <=
Date()"
 
Back
Top