Urgent help required

zeeshanaslamdurrani

Registered User.
Local time
Today, 10:55
Joined
Nov 7, 2012
Messages
10
Hi Guys,

I have a simple access table with 400 employee names. I have a report showing all these 400 records. Please share a vba code that I can fix with that button.

Once the button is clicked 400 pdf files are created one pdf file for every row or recordset. Please share complete code as I have searched everywhere on the internet but no solution seems to work for me.
 
Hi zeeshanaslamdurrani, Welcome to AWF

Take a step back, explain what you have now ! What you want to do, what have you done, what is not working, what is not happening as you wish it to. Your description is completely vague and makes no sense !
 
A few hints:

1. Some 5-10 % of questions in the reports and macro section concern creating reports, making pdf's of them, emailing them, coooking them, boiling them, whatever - search this site.

2. When posting use a title describing the issue, not your needs or state of mind. The solution will then be easily identifiable for the supporters, and findable by all other subsequent visitors. ALL posts here "require help" so that is redundant. "Urgent" is your problem and not ours. If urgent enough, pay someone to sort out your problem.
 
Ok let me explain basically I have a table "employee" in access database with 400 records in it. The only two fields in this table are ID and Employee-Names.

I want to generate multiple pdf files one for each record in my employee table. So is there anyway I can automate creating these pdf files.
 
I am using below code but it is not working

Private Sub Command9_Click()


Dim db As Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT DISTINCT ID FROM Employees WHERE term=" & Forms!frmimport!ID)

With rs
While Not rs.EOF
DoCmd.OpenReport "e", acViewPreview, , "Faculty = '" & rs!Faculty & "'"
DoCmd.OutputTo acOutputReport, "Backgrounds", acFormatPDF, "C:\test\" & rs!fn
DoCmd.Close
rs.MoveNext
Wend
End With

End Sub
 

Users who are viewing this thread

Back
Top Bottom