Version =20
VersionRequired =20
Checksum =-154186012
Begin Form
    PopUp = NotDefault
    RecordSelectors = NotDefault
    MaxButton = NotDefault
    MinButton = NotDefault
    ControlBox = NotDefault
    NavigationButtons = NotDefault
    CloseButton = NotDefault
    DividingLines = NotDefault
    AllowDesignChanges = NotDefault
    DefaultView =0
    TabularFamily =0
    BorderStyle =3
    PictureAlignment =2
    DatasheetGridlinesBehavior =3
    GridY =10
    Width =10318
    DatasheetFontHeight =10
    ItemSuffix =127
    Left =7065
    Top =4080
    Right =26010
    Bottom =15435
    DatasheetGridlinesColor =12632256
    RecSrcDt = Begin
        0x40cfb4c14e42e440
    End
    RecordSource ="qry_TarifKalkulationProv"
    Caption ="Kalkulation"
    OnOpen ="Mkr_Max"
    DatasheetFontName ="Arial"
    PrtMip = Begin
        0xa0050000a0050000a0050000a005000000000000201c0000e010000001000000 ,
        0x010000006801000000000000a10700000100000001000000
    End
    PrtDevMode = Begin
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x010400069c00bc031fd30100010009009a0b3408640001000700580201000100 ,
        0x5802010000004134000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000010000000000000001000000 ,
        0x0200000001000000000000000000000000000000000000000000000050524956 ,
        0xe030000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000180000000000102710271027 ,
        0x000010270000000000000000e800bc0300000000000000000000000000000000 ,
        0x0000000000000000030000000000000000001000503403002888040000000000 ,
        0x000000000000000000000000000000000000000000000000cb0077d408000000 ,
        0x00000000010001000000ff000200000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x01000000000000000000000000000000e8000000534d544a000000001000d800 ,
        0x4100700070006c00650020004c00610073006500720057007200690074006500 ,
        0x72002000380035003000300000005265736f6c7574696f6e0036303064706900 ,
        0x4475706c6578004e6f6e650042697473506572506978656c004e6f6e6500536d ,
        0x6f6f7468696e670046616c7365005061676553697a65004c6574746572005061 ,
        0x6765526567696f6e0000496e707574536c6f74005374616e6461726443617373 ,
        0x6574746500547261795377697463680054727565000000000000000000000000 ,
        0x000000000000000000000000000000000000000000000000
    End
    PrtDevNames = Begin
        0x08001f005d000100000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000000000 ,
        0x0000000000000000000000000000000000000000000000000000000000545330 ,
        0x303100
    End
    AllowPivotTableView =0
    AllowPivotChartView =0
    AllowPivotChartView =0
    Begin
        Begin Label
            BackStyle =0
            FontName ="Tahoma"
        End
        Begin CommandButton
            Width =1701
            Height =283
            FontSize =8
            FontWeight =400
            ForeColor =-2147483630
            FontName ="Tahoma"
        End
        Begin OptionButton
            SpecialEffect =2
            LabelX =230
            LabelY =-30
        End
        Begin CheckBox
            SpecialEffect =2
            LabelX =230
            LabelY =-30
        End
        Begin OptionGroup
            SpecialEffect =3
            Width =1701
            Height =1701
        End
        Begin TextBox
            FELineBreak = NotDefault
            SpecialEffect =2
            OldBorderStyle =0
            Width =1701
            LabelX =-1701
            FontName ="Tahoma"
            AsianLineBreak =255
        End
        Begin ListBox
            SpecialEffect =2
            Width =1701
            Height =1417
            LabelX =-1701
            FontName ="Tahoma"
        End
        Begin ComboBox
            SpecialEffect =2
            Width =1701
            LabelX =-1701
            FontName ="Tahoma"
        End
        Begin Subform
            SpecialEffect =2
            Width =1701
            Height =1701
        End
        Begin PageHeader
            DisplayWhen =1
            Height =0
            BackColor =16777164
            Name ="Seitenkopfbereich"
            GUID = Begin
                0xad6150c73da69a46a5fc18a8817efd75
            End
        End
        Begin Section
            CanGrow = NotDefault
            Height =10724
            Name ="Detailbereich"
            GUID = Begin
                0x676061493def0e4189721ee207a109a4
            End
            Begin
                Begin ListBox
                    OverlapFlags =85
                    IMESentenceMode =3
                    Left =60
                    Top =120
                    Width =9075
                    Height =7702
                    FontSize =10
                    Name ="Liste9"
                    RowSourceType ="Table/Query"
                    RowSource ="SELECT [qry_TarifProv].[Tarif] FROM [qry_TarifProv];"
                    ColumnWidths ="1440"
                    AfterUpdate ="[Event Procedure]"
                    FontName ="Arial"
                    GUID = Begin
                        0x21641010a4ded949ab1e36c6d3d4f68c
                    End
                End
                Begin TextBox
                    Locked = NotDefault
                    OverlapFlags =85
                    IMESentenceMode =3
                    Left =60
                    Top =7995
                    Width =9066
                    Height =300
                    FontSize =10
                    TabIndex =2
                    Name ="Tarif"
                    ControlSource ="Tarif"
                    FontName ="Arial"
                    GUID = Begin
                        0xdf38faa6356cfd4bafd787133883d062
                    End
                End
                Begin TextBox
                    Locked = NotDefault
                    OverlapFlags =85
                    TextAlign =3
                    IMESentenceMode =3
                    Left =1642
                    Top =8832
                    Width =2271
                    Height =255
                    TabIndex =3
                    Name ="ProvGesamt"
                    ControlSource ="ProvGesamt"
                    GUID = Begin
                        0xcd4878e32d3fdc49a973b520a7435cc0
                    End
                End
                Begin TextBox
                    Locked = NotDefault
                    OverlapFlags =85
                    TextAlign =3
                    IMESentenceMode =3
                    Left =1642
                    Top =9132
                    Width =2271
                    Height =285
                    TabIndex =4
                    Name ="ProvAD"
                    ControlSource ="ProvAD"
                    GUID = Begin
                        0xb459e5635ff48c44b7f00e49eacb8c5e
                    End
                End
                Begin TextBox
                    Locked = NotDefault
                    DecimalPlaces =2
                    OverlapFlags =85
                    TextAlign =3
                    IMESentenceMode =3
                    Left =1661
                    Top =9475
                    Width =2271
                    Height =255
                    TabIndex =1
                    Name ="GGneu"
                    ControlSource ="GG"
                    Format ="Standard"
                    GUID = Begin
                        0xb33fe550a3ae634d999be2f08fa619a0
                    End
                End
                Begin Label
                    OverlapFlags =85
                    Left =60
                    Top =9465
                    Width =1200
                    Height =240
                    Name ="Bezeichnungsfeld51"
                    Caption ="GG neu / Monat"
                    GUID = Begin
                        0xe5d0b7b6a6d0dd469992fec6234d7f75
                    End
                End
                Begin Label
                    OverlapFlags =85
                    Left =56
                    Top =8807
                    Width =1200
                    Height =240
                    Name ="Bezeichnungsfeld113"
                    Caption ="Prov gesamt"
                    GUID = Begin
                        0xd9520dab80ea23469d73ae57325c042e
                    End
                End
                Begin Label
                    OverlapFlags =85
                    Left =56
                    Top =9167
                    Width =1200
                    Height =240
                    Name ="Bezeichnungsfeld114"
                    Caption ="Prov AD"
                    GUID = Begin
                        0xd45ed3bf27f6c44aa7446af1d17cbd52
                    End
                End
                Begin CommandButton
                    OverlapFlags =85
                    Left =8617
                    Top =10148
                    Width =576
                    Height =576
                    TabIndex =5
                    Name ="Befehl126"
                    Caption ="Befehl126"
                    OnClick ="[Event Procedure]"
                    PictureData = Begin
                        0x2800000010000000100000000100040000000000800000000000000000000000 ,
                        0x0000000000000000000000000000800000800000008080008000000080008000 ,
                        0x8080000080808000c0c0c0000000ff00c0c0c00000ffff00ff000000c0c0c000 ,
                        0xffff0000ffffff00dadad0dadadadadaadad00adadadadaddad030dadadadada ,
                        0xad0330adadadadad0033300000000adaa03330ff0dadadadd03300ff0adad4da ,
                        0xa03330ff0dad44add03330ff0ad44444a03330ff0d444444d03330ff0ad44444 ,
                        0xa0330fff0dad44add030ffff0adad4daa00fffff0dadadadd00000000adadada ,
                        0xadadadadadadadad000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000000000000000000000000000000000000000000000000000 ,
                        0x0000000000000000
                    End
                    ObjectPalette = Begin
                        0x0003100000000000800000000080000080800000000080008000800000808000 ,
                        0x80808000c0c0c000ff000000c0c0c000ffff00000000ff00c0c0c00000ffff00 ,
                        0xffffff0000000000
                    End
                    ControlTipText ="Formular schließen"
                    GUID = Begin
                        0xee045284248630478f55829805c944da
                    End
                End
            End
        End
        Begin PageFooter
            DisplayWhen =1
            Height =0
            BackColor =16777164
            Name ="Seitenfußbereich"
            GUID = Begin
                0x841284f6a3f5e34697050cf30ee49ea6
            End
        End
    End
End
CodeBehindForm
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Compare Database

Private Sub Liste3_AfterUpdate()
    ' Den mit dem Steuerelement übereinstimmenden Datensatz suchen.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Tarif] = '" & Me![Liste3] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub ErsparnisOhneAltlostenUeberLaufzeit_Exit(Cancel As Integer)
Dim EmAk As Double
Dim EmAkVVL As Double

If Me.GGaltKleinstmoeglichMitTWGebuehr <> "" Then

 EmAk = Me.ErsparnisOhneAltlostenUeberLaufzeit - Me.GGaltKleinstmoeglichMitTWGebuehr
Me.ErsparnisMitAltlostenUeberLaufzeit = EmAk
Else
If Me.GGaltKleinstmoeglichMitTWGebuehrUndVVLgesamt <> "" Then

EmAkVVL = Me.ErsparnisOhneAltlostenUeberLaufzeit - Me.GGaltKleinstmoeglichMitTWGebuehrUndVVLgesamt
Me.ErsparnisMitAltlostenUeberLaufzeitmitVVL = EmAkVVL

End If
End If

End Sub

Private Sub GGbefreiungMonate_Exit(Cancel As Integer)
Dim Vertragslfz As Integer

If Me.GGbefreiungMonate > 2 Then
Vertragslfz = 36

Me.Vertragslaufzeit = Vertragslfz
End If
End Sub

Private Sub GGneu_Exit(Cancel As Integer)

Dim DifGGaltNeu As Double

DifGGaltNeu = (Me.GGalt - Me.GGneu) * Me.RestlaufzeitBisMoeglicherTW

Me.DifferenzGGAltNeuvorTW = DifGGaltNeu



End Sub

Private Sub InnlandskostenAlt_Exit(Cancel As Integer)
If IsNull(Me.GGalt) Then
MsgBox ("Bitte GG Altvertrag angeben")
Else
If IsNull(Me.InnlandskostenAlt) Then
MsgBox ("Bitte Innlandskosten Altvertrag angeben")
Else

Dim GKalt As Double
GKalt = Me.GGalt + Me.InnlandskostenAlt
Me.GesamtkostenAlt = GKalt
End If
End If
End Sub

Private Sub KostenAltGesamt_Exit(Cancel As Integer)

Dim EoAk As Double

If Me.GGbefreiungMonate > 0 Then

EoAk = Me.KostenAltGesamt - ((Me.TarifUndOptionNeu * Me.Vertragslaufzeit) - (Me.GGBefreiungGesamtbetrag * Me.GGbefreiungMonate))
End If
 
If Me.GGbefreiungMonate = 0 Then


EoAk = Me.KostenAltGesamt - (Me.TarifUndOptionNeu * Me.Vertragslaufzeit)

End If
Me.ErsparnisOhneAltlostenUeberLaufzeit = EoAk

End Sub

Private Sub Liste9_AfterUpdate()
    ' Den mit dem Steuerelement übereinstimmenden Datensatz suchen.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Tarif] = '" & Me![Liste9] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub OptionskostenNeu_Exit(Cancel As Integer)
Dim GGuOption As Double
GGuOption = Me.GG + Me.OptionskostenNeu
Me.TarifUndOptionNeu = GGuOption
End Sub

Private Sub Restlaufzeit_Exit(Cancel As Integer)

If 9 = 0 Then

Dim RLZTW As Integer
RLZTW = Me.Restlaufzeit - Me.RestmonateVorTW
If (RLZTW > 0) Then Me.RestlaufzeitBisMoeglicherTW = RLZTW
If (RLZTW <= 0) Then Me.RestlaufzeitBisMoeglicherTW = 0
End If
End Sub

Private Sub RestlaufzeitBisMoeglicherTW_Exit(Cancel As Integer)
If IsNull(Me.RestlaufzeitBisMoeglicherTW) Then
MsgBox ("Restlaufzeit bis möglicher TW eingeben")
Else
Dim RLZKT As Double
RLZKT = Me.Restlaufzeit - Me.RestlaufzeitBisMoeglicherTW
Me.RestlaufzeitKleinstMoeglicherTarif = RLZKT
End If
End Sub

Private Sub RestlaufzeitKleinstMoeglicherTarif_Exit(Cancel As Integer)
If IsNull(Me.GGKleinstMoeglich) Then
MsgBox ("Kleinst mögliche GG Altvertrag eingeben")
Else

Dim GGaltTW As Double
Dim GGaltTWVVL As Double

If Me.VVLjanein = "VVL Nein" Then

GGaltTW = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (Me.RestlaufzeitKleinstMoeglicherTarif * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr

Me.GGaltKleinstmoeglichMitTWGebuehr = GGaltTW

Else
If Me.VVLjanein = "VVL Ja" Then
GGaltTWVVL = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (24 * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr
Me.GGaltKleinstmoeglichMitTWGebuehrUndVVLgesamt = GGaltTWVVL

End If
End If
End If

End Sub

Private Sub RestmonateVorTW_Exit(Cancel As Integer)
If IsNull(Me.GGKleinstMoeglich) Then
MsgBox ("Kleinst mögliche GG Altvertrag eingeben")
Else

Dim GGaltTW As Integer
Dim GGaltTWVVL As Integer

If Me.VVLjanein = "VVL Nein" Then

GGaltTW = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (Me.RestlaufzeitKleinstMoeglicherTarif * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr

Me.GGaltKleinstmoeglichMitTWGebuehr = GGaltTW

Else
If Me.VVLjanein = "VVL Ja" Then
GGaltTWVVL = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (24 * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr
Me.GGaltKleinstmoeglichMitTWGebuehrUndVVLgesamt = GGaltTWVVL

End If
End If
End If
End Sub

Private Sub TarifUndOptionNeu_Exit(Cancel As Integer)
Dim DifGGaltNeu2 As Double

DifGGaltNeu2 = (Me.GGalt - Me.TarifUndOptionNeu) * Me.RestlaufzeitBisMoeglicherTW

Me.DifferenzGGAltNeuvorTW = DifGGaltNeu2
End Sub

Private Sub TarifwechselGebühr_Exit(Cancel As Integer)
Dim GGaltTW As Integer
Dim GGaltTWVVL As Integer

GGaltTW = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (Me.RestlaufzeitKleinstMoeglicherTarif * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr

Me.GGaltKleinstmoeglichMitTWGebuehr = GGaltTW

GGaltTWVVL = (Me.RestlaufzeitBisMoeglicherTW * Me.GGalt) + (24 * Me.GGKleinstMoeglich) + Me.TarifwechselGebühr
Me.GGaltKleinstmoeglichMitTWGebuehrUndVVLgesamt = GGaltTWVVL

End Sub

Private Sub VertragsendeAlt_Exit(Cancel As Integer)
If IsNull(Me.RufNummer) Then
MsgBox ("Bitte Rufnummer Altvertrag eingeben")
Else
If IsNull(Me.VertragsendeAlt) Then
MsgBox ("Bitte Vertragsende Altvertrag eingeben")
Else
If IsNull(Me.VertragsbeginnNeu) Then
MsgBox ("Bitte Vertragsbeginn Neuvertrag eingeben")
Else

Dim RLZ As Integer
RLZ = DateDiff("m", Me.VertragsbeginnNeu, Me.VertragsendeAlt)
Me.Restlaufzeit = RLZ
End If
End If
End If
End Sub

Private Sub Vertragslaufzeit_Exit(Cancel As Integer)
Dim KAG As Double
KAG = Me.Vertragslaufzeit * Me.GesamtkostenAlt
Me.KostenAltGesamt = KAG
End Sub

Private Sub VVLjanein_GotFocus()
 Me!VVLjanein.DropDown
End Sub
Private Sub Befehl90_Click()
On Error GoTo Err_Befehl90_Click


    DoCmd.Close

Exit_Befehl90_Click:
    Exit Sub

Err_Befehl90_Click:
    MsgBox Err.Description
    Resume Exit_Befehl90_Click
    
End Sub
Private Sub Bericht_Kostenanalyse_Sachbearbeiter_Click()
On Error GoTo Err_Bericht_Kostenanalyse_Sachbearbeiter_Click

    Dim stDocName As String

    stDocName = "qry_KostenanalyseBericht"
    DoCmd.OpenReport stDocName, acPreview

Exit_Bericht_Kostenanalyse_Sachbearbeite:
    Exit Sub

Err_Bericht_Kostenanalyse_Sachbearbeiter_Click:
    MsgBox Err.Description
    Resume Exit_Bericht_Kostenanalyse_Sachbearbeite
    
End Sub
Private Sub Befehl126_Click()
On Error GoTo Err_Befehl126_Click


    DoCmd.Close

Exit_Befehl126_Click:
    Exit Sub

Err_Befehl126_Click:
    MsgBox Err.Description
    Resume Exit_Befehl126_Click
    
End Sub