Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Certificate Report?

Status
Not open for further replies.

rleestma

Technical User
Jul 31, 2001
99
US
Hi there...

I'm trying to create a certificate report, so that when i create a new certificate record in my certificates table, I can hit PRINT on my FORM and it will pull up a report with the data currently displayed in my form in the report.

This will allow me to create certificates on the fly...

HOW DO I DO THIS?? I don't want to use the same data over and over, as issuance dates, certificate numbers and such will change...

Thanks,

Ryan Leestma
ryanleestma@netnitco.net
 
Make a report that has the certificate for all records, then you can call the report and restrict it to only the current record using the Where clause of the DoCmd.OpenReport function.

stDocName = "MyCertificateReport"
stDocWhere = "[RecordID] = " & Me.ControlNameOfRecordID

DoCmd.OpenReport stDocName, , stDocWhere

HTH Joe Miller
joe.miller@flotech.net
 
So, where do I put all this programming in? I'm a NEWBIE!!!

L8er,

Ry
 
Click on the reports tab, add a new report using the wizard, select the table/query providing the information for the certificate and make your report look like a certificate.

Open the form with the records you want to print. Add a command button and select print a report from the wizard. Go into the code window, find the line that says stDocName = "MyReportName" and modify accordingly like up above.

The Orders form of the Northwind database has an example of how to do this. It comes with all Office installs and is in the Program Files\Microsoft Office\Office\Samples directory.

Joe Miller
joe.miller@flotech.net
 
I tried it and it keeps printing out a page for every record...

Here's what I coded...

Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

Dim stDocName As String

stDocName = "SLA Certificate"
stDocWhere = "[SLANumber]=" & Me.SLANumber


DoCmd.OpenReport stDocName, , stDocWhere



What's going on?

Thanks,

Ry
 
Sorry, I missed a constant in the line for the OpenReport. It goes like this:

DoCmd.OpenReport stDocName, acPreview, , stDocWhere Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top