Dynamic report (using a template)

moishy

Registered User.
Local time
Today, 23:11
Joined
Dec 14, 2009
Messages
264
I'm creating a db for a realtor.

One table holds all the property information, another, the clients and what they are looking for.

I'm looking for a way to create a dynamic report (using a template) to print a list of the properties that match the criteria of each client.

Any ideas and/or samples are welcome.

Thanks in advance.​
 
Last edited:
moishy I'm almost certain you know how to do this for forms already. It's the same principle for reports as well. I'm talking about using the fourth parameter of the WHERE condition:

docmd.OpenReport "ReportName", acViewPreview, , "WHERE condition"

For more:

http://baldyweb.com/wherecondition.htm
 
What I meant to ask is how can I loop thru all the client records printing the proper information.
 
We've provided this solution many times. Perform a search for it. You need to loop using a recordset.
 
Is something like this what you're referring to:

Code:
[FONT=monospace][/FONT]
  Dim db      As DAO.Database
  Dim rs      As DAO.Recordset
  
  Set db = CurrentDb
  Set rs = db.OpenRecordset(tblContacts, dbOpenDynaset)

  Do While Not rs.EOF
    Docmd.OpenReport "ReportName", acViewPreview, , "WHERE condition"
    rs.MoveNext
  Loop

  Set rs = Nothing
  Set db = Nothing
 
Printing to paper and or emailing using cdo.
 
I'm sure you know the necessary Print command(s) to issue to get it to print. As for e-mailing, you're obviously going to need to save as a pdf before you e-mail.
 
Let us know how it goes or if you need further clarification.
 

Users who are viewing this thread

Back
Top Bottom