Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmdPDF_Click()
On Error GoTo Err_Handler
Const MESSAGE_TEXT1 = "No current DATA."
Const MESSAGE_TEXT2 = "No folder set for storing PDF files."
Dim strFullPath As String
Dim varFolder As Variant
strTest = Me.LstTerm.Value
MsgBox (strTest)
If Not IsNull(Me.LstTerm) Then
[COLOR=#4E9A06]' build path to save PDF file[/color]
varFolder = DLookup("Folderpath", "pdfFolder")
strFullPath = varFolder & "\" & Me.cmdPDF_.Column(1) & "FALL-COHORT" & ".pdf"
[COLOR=#4E9A06]' ensure current record is saved before creating PDF file[/color]
Me.Dirty = False
DoCmd.OutputTo acOutputReport, "FALL-COHORT", acFormatPDF, strFullPath, True
End If[COLOR=#CC0000]
Else [COLOR=#4E9A06]'there is no If for this statement so it won't compile[/color]
MsgBox MESSAGE_TEXT1, vbExclamation, "Invalid Operation"
End If[/color]
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Here
End Sub