create a report from a form

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

Guest

I would like to create a report from a form based on certain criteria found
within the form. I would also like for this report to automatically generate
when the database is opened. Basically, what I would like to do is to pull
records from a form whose information has expired and needs to be updated. I
can't find anything to steer me in the right direction or that has a good
example. Can anyone help?
 
Well, records don't live in a form, so you would actually be looking for any
records in a table whose information had been expired.

Basically, just build a query and tell it what constitutes an "expired"
record. Then base your report on that query.

You'd have to give us more details and specifics if you want us to help you
with specific questions.

Rick B
 
I would like to create a report from a form based on certain criteria
found
within the form.

I think you can try using a global varible (strPubVar) to open the report
from a form:

Private Sub cmdPrev_Click()
Dim stDocName As String


strPubVar = Me.txtPubvar
stDocName = "ReportName"

' use acViewPreview if you just want to view, otherwise, it will be printed
directly.

DoCmd.OpenReport stDocName ', [acViewPreview]

End Sub
 
Basically, I've created a database to store company information. When a new
company is entered, one of the fields that has to be filled is the "Entry
Date". Based on that date, I have two unseen fields (in form view), "Expire
Date" & "Current Date". I have a formula for the "Expired Date" that is the
entry date plus two years. I use the current date field as a countdown.
What I would like to happen is upon opening the form, a report is
automatically generated giving a list of all company's whose info has
expired. Basically, if the "Current Date" =< "Expire Date", the company
should be included on the report. What I want to have shown is a message box
informing the user of the number of companies with expired info and giving
the option of printing the list.

I also don't want the message box to go away or allow the user access to the
form unless an option has been chosen. I understand how to ceate a message
box, but the rest - ESPECIALLY connecting the report to the form (or table if
need be) and using the opening of the form as the trigger for the report. If
I can get those two puzzlles solved, I'd be very relieved.

Hope this gives you the information you needed. Thanks for the help, R.Sams
 
Back
Top