473,414 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Help batch printing multiple certificates

Hello,

I have an individual who completes his study. He has multiple licenses and I want to print all licenses in a batch so I can mail them to the individual.

Currently, I am doing each license by themselves and hand sorting to a pile, then putting X number of certificates in a envelope.

The following code is working SOMETIMES:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Command124_Click()
  3.     Dim stState As String
  4.     Dim stLicense As String
  5.     Dim stCert As String
  6.     Dim conn As ADODB.Connection
  7.     Dim rst As ADODB.Recordset
  8.  
  9.     Set rst = New ADODB.Recordset
  10.     Set conn = CurrentProject.Connection
  11.  
  12.     rst.Open "Select * from tblTempCourse", conn, adOpenStatic
  13.     Forms![frmReports]![LabelType] = 3
  14.  
  15. Do While Not rst.EOF
  16.  
  17.     Forms![frmReports]![AdvCert] = " "
  18.     Forms![frmReports]![TypeLicense] = " "
  19.     Forms![frmReports]![StName] = " "
  20.  
  21.     stLicense = rst.Fields("StateName").Value
  22.     Forms![frmReports]![TypeLicense] = stLicense
  23.  
  24.     stState = rst.Fields("CreditState").Value
  25.     Forms![frmReports]![StName] = stState
  26.  
  27.     stCert = rst.Fields("LicenseType").Value
  28.     Forms![frmReports]![AdvCert] = stCert
  29.  
  30. If stLicense = stCert Then
  31.     If stState = "AK" Then
  32.     DoCmd.OpenReport "rptAK", acPreview
  33.     ElseIf stState = "AL" Then
  34.     DoCmd.OpenReport "rptAL", acPreview
  35.     ElseIf stState = "AR" Then
  36.     DoCmd.OpenReport "rptAR", acPreview
  37.     ElseIf stState = "CA" Then
  38.     DoCmd.OpenReport "rptCA", acPreview
  39.     ElseIf stState = "CO" Then
  40.     DoCmd.OpenReport "rptCO", acPreview
  41.     ElseIf stState = "DC" Then
  42.     DoCmd.OpenReport "rptDC", acPreview
  43.     ElseIf stState = "DE" Then
  44.     DoCmd.OpenReport "rptDE", acPreview
  45.     ElseIf stState = "FL" Then
  46.     DoCmd.OpenReport "rptFL", acPreview
  47.     ElseIf stState = "FB" Then
  48.     DoCmd.OpenReport "rptFB", acPreview
  49.     ElseIf stState = "GA" Then
  50.     DoCmd.OpenReport "rptGA", acPreview
  51.     ElseIf stState = "HI" Then
  52.     DoCmd.OpenReport "rptHI", acPreview
  53.     ElseIf stState = "IA" Then
  54.     DoCmd.OpenReport "rptIA", acPreview
  55.     ElseIf stState = "IL" Then
  56.     DoCmd.OpenReport "rptIL", acPreview
  57.     ElseIf stState = "KS" Then
  58.     DoCmd.OpenReport "rptKS", acPreview
  59.     ElseIf stState = "KY" Then
  60.     DoCmd.OpenReport "rptKY", acPreview
  61.     ElseIf stState = "LA" Then
  62.     DoCmd.OpenReport "rptLA", acPreview
  63.     ElseIf stState = "MA" Then
  64.     DoCmd.OpenReport "rptMA", acPreview
  65.     ElseIf stState = "MD" Then
  66.     DoCmd.OpenReport "rptMD", acPreview
  67.     ElseIf stState = "ME" Then
  68.     DoCmd.OpenReport "rptME", acPreview
  69.     ElseIf stState = "MN" Then
  70.     DoCmd.OpenReport "rptMN", acPreview
  71.     ElseIf stState = "MO" Then
  72.     DoCmd.OpenReport "rptMO", acPreview
  73.     ElseIf stState = "MS" Then
  74.     DoCmd.OpenReport "rptMS", acPreview
  75.     ElseIf stState = "MT" Then
  76.     DoCmd.OpenReport "rptMT", acPreview
  77.     ElseIf stState = "NC" Then
  78.     DoCmd.OpenReport "rptNC", acPreview
  79.     ElseIf stState = "ND" Then
  80.     DoCmd.OpenReport "rptND", acPreview
  81.     ElseIf stState = "NE" Then
  82.     DoCmd.OpenReport "rptNE", acPreview
  83.     ElseIf stState = "NH" Then
  84.     DoCmd.OpenReport "rptNH", acPreview
  85.     ElseIf stState = "NJ" Then
  86.     DoCmd.OpenReport "rptNJ", acPreview
  87.     ElseIf stState = "NM" Then
  88.     DoCmd.OpenReport "rptNM", acPreview
  89.     ElseIf stState = "NV" Then
  90.     DoCmd.OpenReport "rptNV", acPreview
  91.     ElseIf stState = "NY" Then
  92.     DoCmd.OpenReport "rptNY", acPreview
  93.     ElseIf stState = "OH" Then
  94.     DoCmd.OpenReport "rptOH", acPreview
  95.     ElseIf stState = "OK" Then
  96.     DoCmd.OpenReport "rptOK", acPreview
  97.     ElseIf stState = "OR" Then
  98.     DoCmd.OpenReport "rptOR", acPreview
  99.     ElseIf stState = "PA" Then
  100.     DoCmd.OpenReport "rptPA", acPreview
  101.     ElseIf stState = "RI" Then
  102.     DoCmd.OpenReport "rptRI", acPreview
  103.     ElseIf stState = "SC" Then
  104.     DoCmd.OpenReport "rptSC", acPreview
  105.     ElseIf stState = "SD" Then
  106.     DoCmd.OpenReport "rptSD", acPreview
  107.     ElseIf stState = "TN" Then
  108.     DoCmd.OpenReport "rptTN", acPreview
  109.     ElseIf stState = "TX" Then
  110.     DoCmd.OpenReport "rptTX", acPreview
  111.     ElseIf stState = "UT" Then
  112.     DoCmd.OpenReport "rptUT", acPreview
  113.     ElseIf stState = "VA" Then
  114.     DoCmd.OpenReport "rptVA", acPreview
  115.     ElseIf stState = "VT" Then
  116.     DoCmd.OpenReport "rptVT", acPreview
  117.     ElseIf stState = "WA" Then
  118.     DoCmd.OpenReport "rptWA", acPreview
  119.     ElseIf stState = "WV" Then
  120.     DoCmd.OpenReport "rptWV", acPreview
  121.     ElseIf stState = "WY" Then
  122.     DoCmd.OpenReport "rptWY", acPreview
  123.     'Else
  124.     'MsgBox "No Report for that State."
  125.     End If
  126. End If
  127.  
  128.     'stCert = rst.Fields("LicenseType").Value
  129.     'Forms![frmReports]![AdvCert] = stCert
  130.  
  131. If stLicense <> stCert Or stState = stLicense Then
  132.  
  133.     If stCert = "CFP" Then
  134.     DoCmd.OpenReport "rptCFP", acPreview
  135.     ElseIf stCert = "ChFC" Then
  136.     DoCmd.OpenReport "rptChFC", acPreview
  137.     ElseIf stCert = "CPA" Then
  138.     DoCmd.OpenReport "rptCPA", acPreview
  139.     ElseIf stCert = "CRC" Then
  140.     DoCmd.OpenReport "rptCRC", acPreview
  141.     ElseIf stCert = "CASL" Then
  142.     DoCmd.OpenReport "rptCASL", acPreview
  143.     ElseIf stCert = "RHU" Then
  144.     DoCmd.OpenReport "rptRHU", acPreview
  145.     ElseIf stCert = "CLU" Then
  146.     DoCmd.OpenReport "rptCLU", acPreview
  147.     ElseIf stCert = "CRPC" Then
  148.     DoCmd.OpenReport "rptCRPC", acPreview
  149.     ElseIf stCert = "CRPS" Then
  150.     DoCmd.OpenReport "rptCRPS", acPreview
  151.     ElseIf stCert = "CIMA" Then
  152.     DoCmd.OpenReport "rptCIMA", acPreview
  153.     ElseIf stCert = "CMFC" Then
  154.     DoCmd.OpenReport "rptCMFC", acPreview
  155.     ElseIf stCert = "LUTC" Then
  156.     DoCmd.OpenReport "rptLUTC", acPreview
  157.     'Else
  158.     'MsgBox "No Report for that Certificate."
  159.     End If
  160. End If
  161.  
  162. rst.MoveNext
  163. Loop
  164.  
  165.     Forms![frmReports]![AdvCert] = " "
  166.     Forms![frmReports]![TypeLicense] = " "
  167.     Forms![frmReports]![StName] = " "
  168.  
  169.     rst.Close
  170.     Set rst = Nothing
  171.     conn.Close
  172.     Set conn = Nothing
  173.  
  174. End Sub
  175.  
  176.  
Basically, I would like the print job to get the individual, print a state, then any other certs, and then move to next person.

Thanks for your help.
Aug 16 '10 #1
0 1101

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sigurd Bruteig | last post by:
Hi all! I have a problem printing multiple reports. The code i use is: Dim stDocName As String stDocName = "rptInvoice" DoCmd.OpenReport stDocName, acNormal, , " = date()" The problem is that...
3
by: MHenry | last post by:
Hi, I have 30 separate Access reports to print to pdf files. Presently, I print these reports to Acrobat pdf files one report at a time. I am looking for some help, or a program or add-in...
2
by: Ardie | last post by:
Hi, I'm currently working on a webapp that generates reports for the user and i was wondering if there was a way to do batch printing. I was playing around with the idea of sending the reports...
1
by: mark | last post by:
I can't seem to get the logic for printing multiple pages. I know I have to do a comparison between the bottom margin and the position of the next line to be printed and initiate a has more pages...
1
by: Mitchell Vincent | last post by:
I've had this trouble in every language I've tried for Windows. Apparently the problem is with the underlying controls or something.. When I loop through and use a hidden web gadget to load and...
1
by: Parasyke | last post by:
Thanks for any help.. I currently have a database with about 100 products with picture links in an external folder. I have a form from which I can successfully display a product, its...
0
by: grezz5 | last post by:
hi im new to all this and need help with printing a bitmap image to a thermol point of sale printer, using vb.net plz someone help. any sugestions welcome... i have looked everywhere and cant find...
1
by: Casey Skousen | last post by:
I want to be able to batch print all records in a header table that have not yet been printed. This should be simple, but due to the format of the report, I cannot just print all records (the...
0
by: jiafangsee | last post by:
Hi, I'm using Visual Studio 2005 and I have a web application where i generated some delivery order in crystal report then it's exported to pdf for viewing and printing. Now I need to develop...
22
Missionary
by: Missionary | last post by:
I need to batch print reports. I've looked at past posts about batch printing, but I don't know visual basic, so I'll need some coaching. I have a report based on a parameter query. I have it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.