If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Loop Through a Microsoft Access Table
I am trying to loop through a table and for each record create a snapshot
report. I need to use the name out of the table to save it under that name. I have the report set up but when you run the report the report is saved as one big report. I need a report for each. Can Somebody help me? |
#2
|
|||
|
|||
how many tables you got
what exactly are you trying to do? |
#3
|
|||
|
|||
I have One Table that is pulling all the data. I am trying to make a snapshot
report of each record in the table. Then I am going to use the snapshots for a website " wrote: how many tables you got what exactly are you trying to do? |
#4
|
|||
|
|||
I will send you the report if you need to look at it. The information is
about datacards. my email " wrote: how many tables you got what exactly are you trying to do? |
#5
|
|||
|
|||
gosh i just dont know if you need data warehousign advice-- or if you
need help with Access snapshots tell me more about what you had in mind like exporting a report to a SNP format through the command line? you can make a macro (docmd. if in vba) OutputTo outputReport, rptName, acSnp; etc let me know what you need |
#6
|
|||
|
|||
can I write a module in access to loop through the table and run the report
for each? " wrote: how many tables you got what exactly are you trying to do? |
#7
|
|||
|
|||
I know how to export the SNP. I think that I need a module to run the report
for each record and take the title name out of the table and make that the file name. I need a SNP report for each record that is in the database so that I can post it on the internet. Do u think I need to use VB.NEt or can I use a module in access? And How? " wrote: gosh i just dont know if you need data warehousign advice-- or if you need help with Access snapshots tell me more about what you had in mind like exporting a report to a SNP format through the command line? you can make a macro (docmd. if in vba) OutputTo outputReport, rptName, acSnp; etc let me know what you need |
#8
|
|||
|
|||
"spenn" wrote in message
I am trying to loop through a table and for each record create a snapshot report. I need to use the name out of the table to save it under that name. I have the report set up but when you run the report the report is saved as one big report. I need a report for each. Can Somebody help me? You can use code something like this "air code": '----- start of example code ----- Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("YourTable") With rs Do Until .EOF DoCmd.OpenReport "YourReport", acViewPreview, , _ "CustomerID=" & !CustomerID DoCmd.OutputTo acOutputReport, , acFormatSNP, _ "C:\Temp\" & !CustomerName & ".snp" DoCmd.Close acReport, "YourReport", acSaveNo .MoveNext Loop .Close End With '----- end of example code ----- The code assumes that there is a field named "CustomerID" that is the (numeric) primary key of table "YourTable", and there's a field named "CustomerName" that is what you want to use as the name of the output snapshot file. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#9
|
|||
|
|||
Do i put that code in a module in access?
"Dirk Goldgar" wrote: "spenn" wrote in message I am trying to loop through a table and for each record create a snapshot report. I need to use the name out of the table to save it under that name. I have the report set up but when you run the report the report is saved as one big report. I need a report for each. Can Somebody help me? You can use code something like this "air code": '----- start of example code ----- Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("YourTable") With rs Do Until .EOF DoCmd.OpenReport "YourReport", acViewPreview, , _ "CustomerID=" & !CustomerID DoCmd.OutputTo acOutputReport, , acFormatSNP, _ "C:\Temp\" & !CustomerName & ".snp" DoCmd.Close acReport, "YourReport", acSaveNo .MoveNext Loop .Close End With '----- end of example code ----- The code assumes that there is a field named "CustomerID" that is the (numeric) primary key of table "YourTable", and there's a field named "CustomerName" that is what you want to use as the name of the output snapshot file. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#10
|
|||
|
|||
i tried that code it says syntax error. here is the code can u tell me
whats wrong? thanks DATACARDS SORT FORM is the table I am getting an error on the openReport The field that i need is Datacard Title. I am getting error on the output to I need the datacard title to be the save name. Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("DATACARDS SORT FORM") With rs Do Until .EOF DoCmd.OpenReport "Datacard Report", acViewPreview, , _ "Datacard Title=" & !Datacard Title DoCmd.OutputTo acOutputReport, , acFormatSNP, _ "C:\Temp\" & !Datacard Title & ".snp" DoCmd.Close acReport, "Datacard Report", acSaveNo .MoveNext Loop .Close End With "Dirk Goldgar" wrote: "spenn" wrote in message I am trying to loop through a table and for each record create a snapshot report. I need to use the name out of the table to save it under that name. I have the report set up but when you run the report the report is saved as one big report. I need a report for each. Can Somebody help me? You can use code something like this "air code": '----- start of example code ----- Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("YourTable") With rs Do Until .EOF DoCmd.OpenReport "YourReport", acViewPreview, , _ "CustomerID=" & !CustomerID DoCmd.OutputTo acOutputReport, , acFormatSNP, _ "C:\Temp\" & !CustomerName & ".snp" DoCmd.Close acReport, "YourReport", acSaveNo .MoveNext Loop .Close End With '----- end of example code ----- The code assumes that there is a field named "CustomerID" that is the (numeric) primary key of table "YourTable", and there's a field named "CustomerName" that is what you want to use as the name of the output snapshot file. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2002 vs 2003 | Patrick Stubbin | General Discussion | 2 | May 17th, 2005 07:27 AM |
Access combo box-show name, not ID, in table? | write on | New Users | 30 | April 30th, 2005 09:11 PM |
Many-to-many implementation problem | Al Williams | Database Design | 15 | April 29th, 2005 05:19 PM |
transpose | john | Using Forms | 1 | November 24th, 2004 06:16 PM |
Adding staff photographs to my database | KK | New Users | 2 | September 3rd, 2004 07:41 AM |