Hi Ken:
It is fine now; the end user is OK with that. What I have done is: when
the
1st screen is open a macro prints the report/based on a query; and as I
said
the report is blank when no overdues; just in case please see below;
ideally
I want the report printed just when are overdues; and not to be printed as
a
blank one when not outstanding issues.
Query for report:
SELECT [DQ Issues].IncidentNumber, [DQ Issues].RelatedIncNumber, [DQ
Issues].NatlStoreNo, [DQ Issues].Contact, [DQ Issues].Phone, [DQ
Issues].City, [DQ Issues].SiteDesc, [DQ Issues].Description, [DQ
Issues].Status, [DQ Issues].[Due By], [DQ Issues].OpenedBy, [DQ
Issues].DateOpened, [DQ Issues].DateClosed, [DQ Issues].OpenedPriorWeek,
[DQ
Issues].ClosedPriorWeek, [DQ Issues].Resolution, [DQ Issues].Type, [DQ
Issues].Category, [DQ Issues].[Root Cause], [DQ Issues].Component, [DQ
Issues].Environment, [DQ Issues].Urgency, [DQ Issues].Priority, [DQ
Issues].ClassificationType, [DQ Issues].ClassificationCategory, [DQ
Issues].[Call level], [DQ Issues].Object, [DQ Issues].Assignee, [DQ
Issues].PackageNumber, [DQ Issues].AffectedComponents, [DQ Issues].Source,
[DQ Issues].RelatedIncident, [DQ Issues].History, [DQ Issues].User,
IIf([dateopened]<Date()-2,"Yes") AS Overdue
FROM [DQ Issues]
WHERE ((([DQ Issues].Status)="open") AND
((IIf([dateopened]<Date()-2,"Yes"))="yes"));
****
Macro:
Name: Autoexecute
Action:OpenReport
View: Print
Thanks a lot,
Dan
Ken Snell said:
I don't know what code you're running to run that report. Please post
more
info about that code and when it runs, and we should be able to provide
some
suggestions for you.
--
Ken Snell
<MS ACCESS MVP>
Hi Ken:
Thank you! I get the message when I am on that specific record!; this
if
fine. In addition to that I want, when the user opens the DB to print
the
report with all those overdue records? I have done that; but the
report
is
always printing; when no overudes the report is blank; so I want to
print
the
report just when are overduess
Sorry!
Thank you,
Dan
:
You could use the Current event of the form, and have code that tests
the
value in a control against the current date:
Private Sub Form_Current()
If Len(Me.CloseDate.Value & "") = 0 Then
If DateDiff("d", Me.OpenDate.Value, Date()) > 2 Then
MsgBox "This item has been open for more than 2 days!"
End If
End If
End Sub
--
Ken Snell
<MS ACCESS MVP>
I see. Hmm, this is an answer I'd like to know too. You need your
app
to
check the system time to the closedate. I don't know how to tell
Access
that
while an app is open, check every second, or minute or hour. I
don't
know
how to tell it to check based on an interval of time.
Instead of an 'OnClick' Event, or an "OnOpen' Event, you need an
even
that
checks a condition based on a custom length of time. If any one out
there
knows, I'd like to aswell.
Thanks
Chris