Created
June 10, 2013 14:45
-
-
Save janikvonrotz/5749289 to your computer and use it in GitHub Desktop.
MSAccess: Dropdown Open a Form
#VisualBasic
#MSAccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub btAuswerten_Click() | |
'Folgende Auswertungen sind möglich: | |
'Datenblatt Anlage | |
'Auswertung Wasserzinsen | |
'Auswertung Kontrollrapport | |
'GIS-Erdsonden | |
'GIS-Grundwasser | |
'GIS-Erdregister & Erdpfähle | |
'Ausgewählter Report | |
Dim ChoosedReport As String | |
'Typ Ausgabe: Report oder Query | |
Dim OutputType As String | |
Select Case (Me.ddReportChoice) | |
Case "Datenblatt Anlage" | |
ChoosedReport = "repPumpe" | |
OutputType = "Report" | |
Case "Auswertung Wasserzinsen" | |
ChoosedReport = "qryWasserzins" | |
OutputType = "Query" | |
Case "Auswertung Kontrollrapport" | |
ChoosedReport = "qryKontrollrapport" | |
OutputType = "Query" | |
Case "GIS-Erdsonden" | |
ChoosedReport = "qryGISErdsonden" | |
OutputType = "Query" | |
Case "GIS-Grundwasser" | |
ChoosedReport = "qryGISGrundwasser" | |
OutputType = "Query" | |
Case "GIS-Erdregister & Erdpfähle" | |
ChoosedReport = "qryGISErdregisterErdpfähle" | |
OutputType = "Query" | |
End Select | |
'Schliessen des Wizards | |
DoCmd.Close acForm, Me.Name | |
'Öffnen des Formulars | |
If OutputType = "Report" Then | |
DoCmd.Close acReport, ChoosedReport, acSaveNo | |
DoCmd.OpenReport ChoosedReport, acViewReport | |
ElseIf OutputType = "Query" Then | |
DoCmd.Close acQuery, ChoosedReport, acSaveNo | |
DoCmd.OpenQuery ChoosedReport, acViewNormal | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment