Open and closed cases/lawsuits

E

Ellie

My database consist of cases (lawsuits) with various deadlines. I have
various reports of the different deadlines. Once a case is resolved, I would
like for it not to appear on my active cases reports. Is there a way to
accomplish this without completely removing the case from my database? What I
would really like, is to have the closed cases on a separate report.
 
E

Ellie

Hi Steve,

I do not have have a date opened or closed field on my form.

My database consists of the main table which includes the name of the
parties the courts and judges. Then I have a status table that's tied to the
main table. The status table contains the various deadlines, such as
discovery, mediation, hearing dates, etc. In the reports section, each of
these deadlines have their own report. For example, discovery would have its
own report, listing discovery deadlines in all cases.

I am trying to find a simple solution, because I don't know how to write
codes and know very little about queries. Thanks.
 
J

Jack Cannon

Ellie,

You cannot accomplish your objective unless you have some indicator that
lets you know that a case is closed or resolved. Why not add a closed field
(probably a date field) to the status table that you mentioned?

Jack Cannon
 
E

Ellie

Jack,

If I were to add a date closed field, how would that work to move the closed
cases to the closed report? Is using a checkbox easier?
 
J

Jack Cannon

Ellie,

Yes, you can use a checkbox if you prefer.

I suggested a Date field because that is a critical piece of information for
the application that you are describing and you probably would use that
information in other areas of your application.

Once you have the Closed field whether it be a Date field or a checkbox then
Steve's suggestion is perfectly valid.

Jack Cannon
 
E

Ellie

Jack,

I have to say, I do not understand Steve's reply :-(. My active report is
based on a query, but how does that incorporate to what he suggested?
 
J

Jack Cannon

Ellie,

Steve suggested that you have two reports - one for active cases and one for
closed cases. Each report has its own recordsource that would be a query
similar to the query that you already have for what is being used as the
recordsource for your active report.

The closed field needs to be added to each query and the criteria for it
would be "Is Null" for the Active report and "Not Is Null" for the Closed
report if you are used a Date field. If you are using a checkbox then the
criteria would be "False" for the Active report and "True" for the Closed
report

Jack Cannon
 
A

Arvin Meyer [MVP]

Or you could use a form to initiate a SQL statement which mirrors your
query, using an if, then, else statement to branch which SQL statement is
the recordsource of the report, something like (untested code)

Sub Report_Open(Cancel As Integer)
Dim strSQL As String
Dim strSQL2 As String

If Forms!FormName!chkActiveCase = True Then
strSQL = "Select * From Whatever Where ClosedDate Is Not Null"
Me.recordsource = strSQL
Else
strSQL2 = "Select * From Whatever Where ClosedDate Is Null"
Me.recordsource = strSQL2
End If

End Sub
 
K

ken

Assuming you've used a Boolean (Yes/Mo) Close field in the report's
underlying table, you can cover all bases by using a single report
which as designed shows all cases, but filtering it by opening the
report from a simple unbound dialogue form with three controls, an
option group in which you can select Open, Closed or All Cases, a
check box which if checked sends the report to the printer rather than
the screen, and a button to open the report.

Name the option group fraCaseTypes, the check box chkPrinter and the
button cmdOpenReport. Use the control wizard to set up the option
group and give it three option buttons, with values 1, 2 and 3
corresponding to Open, Closed or All Cases. In the button's Click
event procedure put the following code:

Const REPORTNAME = "YourReportName"
Dim intView As Integer
Dim strCriteria As String

' is report to be printed or previewed?
Select Case Me.chkPrinter
Case True
intView = acViewNormal
Case Else
intView = acViewPreview
End Select

' what case type are to be included?
Select Case Me.fraCaseTypes
Case 1 ' open cases
strCriteria = "Closed = False"
Case 2
strCriteria = "Closed = True"
Case Else
strCriteria = ""
End Select

' open report
DoCmd.OpenReport REPORTNAME, _
View:=intView, _
WhereCondition:=strCriteria

To do this select the button in form design view and open its
properties sheet if its not already open. Then select the On Click
event property in the properties sheet. Click on the 'build' button;
that's the one on the right with 3 dots. Select 'Code Builder' in the
dialogue, and click OK. The VBA window will open at the event
procedure with the first and last lines already in place. Enter the
lines of code (you can copy and paste from above) between these two
existing lines.

Ken Sheridan
Stafford, England
 
J

Jesse Markes

how to get updates?

--
Thank YOU
Jesse J Markes
(c) 518-774-3264
60 Wesleyan Ave
Amsterdam NY, 12010
E-Mail- (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top