VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmHotel 
   AutoRedraw      =   -1  'True
   BackColor       =   &H8000000A&
   BorderStyle     =   0  'Kein
   Caption         =   "Form1"
   ClientHeight    =   11400
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   13170
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   11400
   ScaleWidth      =   13170
   ShowInTaskbar   =   0   'False
   Begin VB.PictureBox PictureBox1 
      Appearance      =   0  '2D
      BackColor       =   &H80000002&
      ForeColor       =   &H80000008&
      Height          =   9525
      Left            =   1380
      ScaleHeight     =   9495
      ScaleWidth      =   10215
      TabIndex        =   1
      Top             =   1080
      Width           =   10245
      Begin VB.Frame Frame2 
         Caption         =   "Sprache"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   990
         Left            =   300
         TabIndex        =   24
         Top             =   7200
         Width           =   9500
         Begin VB.OptionButton Option2 
            Caption         =   "Deutsch"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   0
            Left            =   240
            TabIndex        =   26
            Top             =   420
            Width           =   1455
         End
         Begin VB.OptionButton Option2 
            Caption         =   "Englisch"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   1
            Left            =   1740
            TabIndex        =   25
            Top             =   420
            Width           =   1095
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "Zahlungsart"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   990
         Left            =   300
         TabIndex        =   28
         Top             =   6300
         Width           =   9500
         Begin VB.OptionButton Option1 
            Caption         =   "BAR"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   0
            Left            =   240
            TabIndex        =   31
            Top             =   375
            Width           =   1455
         End
         Begin VB.OptionButton Option1 
            Caption         =   "KARTE"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   1
            Left            =   2025
            TabIndex        =   30
            Top             =   375
            Width           =   1455
         End
         Begin VB.OptionButton Option1 
            Caption         =   "GUTSCHEIN"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   2
            Left            =   4020
            TabIndex        =   29
            Top             =   360
            Width           =   1755
         End
      End
      Begin VB.CommandButton cmdHotelrechnungDE 
         Caption         =   "Hotelrechnung Drucken"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   670
         Left            =   5640
         Style           =   1  'Grafisch
         TabIndex        =   27
         Top             =   8520
         Width           =   1995
      End
      Begin VB.CommandButton cmdSchliessen 
         Caption         =   "Schließen"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   670
         Left            =   8100
         Style           =   1  'Grafisch
         TabIndex        =   23
         Top             =   8520
         Width           =   1700
      End
      Begin VB.Frame frmHoteldaten 
         Caption         =   "Rechnungsdaten"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   6075
         Left            =   300
         TabIndex        =   2
         Top             =   300
         Width           =   9500
         Begin VB.TextBox txtFruehstueckpreis 
            BackColor       =   &H0080FFFF&
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   465
            Left            =   6780
            TabIndex        =   22
            Top             =   3420
            Width           =   2055
         End
         Begin VB.TextBox txtZimmerpreis 
            BackColor       =   &H0080FFFF&
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   465
            Left            =   6780
            TabIndex        =   20
            Top             =   2820
            Width           =   2055
         End
         Begin VB.ComboBox cmbZimmerLeistung 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   390
            Left            =   6780
            TabIndex        =   8
            Top             =   1560
            Width           =   2115
         End
         Begin VB.ComboBox cmbZimmerNr 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   390
            Left            =   6780
            TabIndex        =   7
            Top             =   480
            Width           =   2115
         End
         Begin VB.ComboBox cmbZimmerArt 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   390
            Left            =   6780
            TabIndex        =   6
            Top             =   1020
            Width           =   2115
         End
         Begin VB.TextBox txtZimmerAnzahl 
            BackColor       =   &H0080FFFF&
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   465
            Left            =   6780
            TabIndex        =   5
            Top             =   2160
            Width           =   2055
         End
         Begin VB.TextBox txtGesamtPreis 
            BackColor       =   &H0080FFFF&
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   465
            Left            =   3900
            TabIndex        =   4
            Top             =   5220
            Width           =   2055
         End
         Begin VB.TextBox txtUebernachtungen 
            BackColor       =   &H0080FFFF&
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   465
            Left            =   3900
            TabIndex        =   3
            Top             =   4620
            Width           =   2055
         End
         Begin MSComCtl2.DTPicker DTPickerStartdatum 
            Height          =   420
            Left            =   1440
            TabIndex        =   9
            Top             =   480
            Width           =   2115
            _ExtentX        =   3731
            _ExtentY        =   741
            _Version        =   393216
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            CalendarTitleBackColor=   8421631
            Format          =   42795009
            CurrentDate     =   39250
         End
         Begin MSComCtl2.DTPicker DTPickerEnddatum 
            Height          =   420
            Left            =   1440
            TabIndex        =   10
            Top             =   1080
            Width           =   2115
            _ExtentX        =   3731
            _ExtentY        =   741
            _Version        =   393216
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            CalendarTitleBackColor=   8421631
            Format          =   42795009
            CurrentDate     =   39250
         End
         Begin VB.Label lblFruehstueckpreis 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Frühstückpreis"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4860
            TabIndex        =   21
            Top             =   3540
            Width           =   1455
         End
         Begin VB.Label lblZimmerpreis 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Zimmerpreis"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4860
            TabIndex        =   19
            Top             =   2940
            Width           =   1230
         End
         Begin VB.Label lblZimmerleistung 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Zimmerleistung"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4800
            TabIndex        =   18
            Top             =   1620
            Width           =   1500
         End
         Begin VB.Label lblAbreisedatum 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Abreise"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   420
            TabIndex        =   17
            Top             =   1140
            Width           =   735
         End
         Begin VB.Label lblAnreisedatum 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Anreise"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   420
            TabIndex        =   16
            Top             =   540
            Width           =   735
         End
         Begin VB.Label lblZimmerNr 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Zimmernummer"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4800
            TabIndex        =   15
            Top             =   540
            Width           =   1575
         End
         Begin VB.Label lblZimmerArt 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Zimmerart"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4800
            TabIndex        =   14
            Top             =   1080
            Width           =   1005
         End
         Begin VB.Label lbZimmerAnzahl 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Anzahl"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   4860
            TabIndex        =   13
            Top             =   2280
            Width           =   660
         End
         Begin VB.Label lblGesamtPreis 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Gesamtpreis"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   2040
            TabIndex        =   12
            Top             =   5280
            Width           =   1260
         End
         Begin VB.Label lblUebernachtungen 
            AutoSize        =   -1  'True
            BackColor       =   &H80000002&
            BackStyle       =   0  'Transparent
            Caption         =   "Übernachtungen"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   2040
            TabIndex        =   11
            Top             =   4680
            Width           =   1605
         End
      End
   End
   Begin VB.Label lblHead 
      Alignment       =   2  'Zentriert
      BackColor       =   &H80000013&
      Caption         =   "Label1"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   525
      Left            =   4260
      TabIndex        =   0
      Top             =   0
      Width           =   3345
   End
End
Attribute VB_Name = "frmHotel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
    Me.Top = 0
    Me.Left = 0
    Me.Width = MDIHauptmenu.ScaleWidth - frmLink.Width
    Me.Height = MDIHauptmenu.ScaleHeight

    Me.lblHead.Top = 0
    Me.lblHead.Left = Me.Width / 2 - Me.lblHead.Width / 2
   
    Me.PictureBox1.Top = Me.Height / 2 - Me.PictureBox1.Height / 2
    Me.PictureBox1.Left = Me.Width / 2 - Me.PictureBox1.Width / 2
    
    DTPickerEnddatum.Value = Date
    DTPickerStartdatum.Value = Date - 1
    
    Me.txtZimmerAnzahl.Text = 1
    Me.txtUebernachtungen.Text = 1
    Me.txtZimmerpreis.Text = 1
    
    Call AnsichtAktualisieren(1, "EZ", "ÜF")
    Me.Option1(0).Value = True
    Me.Option2(0).Value = True
End Sub
Private Sub DTPickerStartdatum_Change()
    If DTPickerStartdatum.Value > Date Then
    DTPickerStartdatum.Value = Date
    End If
    
    If DTPickerStartdatum.Value > DTPickerEnddatum.Value Then
         DTPickerEnddatum.Value = DTPickerStartdatum.Value
    ElseIf DTPickerStartdatum.Value > Date Then
        DTPickerStartdatum.Value = DTPickerEnddatum.Value
    End If
    Me.txtUebernachtungen = DTPickerEnddatum.Value - DTPickerStartdatum.Value
End Sub
Private Sub DTPickerEnddatum_Change()
    If DTPickerEnddatum.Value > Date Then
    DTPickerEnddatum.Value = Date
    End If
    
    If DTPickerEnddatum.Value < DTPickerStartdatum.Value Then
        DTPickerStartdatum.Value = DTPickerEnddatum.Value
    ElseIf DTPickerEnddatum.Value > Date Then
        DTPickerEnddatum.Value = Date
    End If
    Me.txtUebernachtungen = DTPickerEnddatum.Value - DTPickerStartdatum.Value
End Sub

Private Sub cmbZimmerNr_Change()
    If Me.cmbZimmerNr.Text = "" Then
        Me.cmbZimmerArt.Text = ""
        Me.cmbZimmerLeistung.Text = ""
        Exit Sub
    End If

    If IsNumeric(cmbZimmerNr.Text) = True Then
        For I = 0 To cmbZimmerNr.ListCount
            If cmbZimmerNr.List(I) = cmbZimmerNr.Text Then
                VarSuchNr = True
                Exit For
            Else
                VarSuchNr = False
            End If
        Next I
    End If
    
    If VarSuchNr = False Or IsNumeric(cmbZimmerNr.Text) = False Then
        cmbZimmerNr.Text = ""
        Exit Sub
    End If
    
        
    Call Me.ComboZimmerArtFuellen(Me.cmbZimmerNr.Text)
    Call Me.ComboZimmerLeistungFuellen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text)

    X = ZimmerPreisAbfragen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text, Me.cmbZimmerLeistung.Text)

    Me.txtZimmerpreis.Text = X
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Private Sub cmbZimmerNr_Click()
    If Me.cmbZimmerNr.Text = "" Then
        Me.cmbZimmerArt.Text = ""
        Me.cmbZimmerLeistung.Text = ""
        Exit Sub
    End If
    Call Me.ComboZimmerArtFuellen(Me.cmbZimmerNr.Text)
    Call Me.ComboZimmerLeistungFuellen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text)

    X = ZimmerPreisAbfragen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text, Me.cmbZimmerLeistung.Text)

    Me.txtZimmerpreis.Text = X
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub

Private Sub cmbZimmerArt_Click()
    If Me.cmbZimmerArt.Text = "" Then
        Me.cmbZimmerNr.Text = ""
        Me.cmbZimmerLeistung.Text = ""
        Exit Sub
    End If

    Call Me.ComboZimmerLeistungFuellen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text)

    X = ZimmerPreisAbfragen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text, Me.cmbZimmerLeistung.Text)

    Me.txtZimmerpreis.Text = X
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub

Private Sub lblZimmerArt_Change()
'scg
End Sub
Private Sub cmbZimmerLeistung_Click()
    If Me.cmbZimmerLeistung.Text = "" Then
        Me.cmbZimmerNr.Text = ""
        Me.cmbZimmerArt.Text = ""
        Exit Sub
    End If

    X = ZimmerPreisAbfragen(Me.cmbZimmerNr.Text, Me.cmbZimmerArt.Text, Me.cmbZimmerLeistung.Text)

    Me.txtZimmerpreis.Text = X
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub

Private Sub txtZimmerAnzahl_Change()
    If IsNumeric(txtZimmerAnzahl.Text) = False Then
        Me.txtZimmerAnzahl.Text = ""
        Exit Sub
    End If
If Me.txtZimmerAnzahl.Text = "" Or Me.txtZimmerpreis.Text = "" Or Me.txtUebernachtungen.Text = "" Then Exit Sub
Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Private Sub txtUebernachtungen_Change()
    If IsNumeric(txtUebernachtungen.Text) = False Then
        Me.txtUebernachtungen.Text = ""
        Exit Sub
    End If
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then
        Me.txtGesamtPreis.Text = ""
        Exit Sub
    End If

    DTPickerStartdatum.Value = DTPickerEnddatum.Value - txtUebernachtungen.Text
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Private Sub txtZimmerpreis_Change()
    If txtZimmerpreis.Text = "" Or txtUebernachtungen.Text = "" Then
        Me.txtGesamtPreis.Text = ""
        Exit Sub
    End If
    If IsNumeric(txtZimmerpreis.Text) = False Then
        Me.txtZimmerpreis.Text = ""
        Exit Sub
    End If
    If Me.txtZimmerAnzahl.Text = "" Or Me.txtZimmerpreis.Text = "" Or Me.txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Private Sub txtFruehstueckpreis_Change()
    If txtFruehstueckpreis.Text = "" Or txtUebernachtungen.Text = "" Then
        Me.txtGesamtPreis.Text = ""
        Exit Sub
    End If
    If IsNumeric(txtFruehstueckpreis.Text) = False Then
        Me.txtFruehstueckpreis.Text = ""
        Exit Sub
    End If
    If Me.txtZimmerAnzahl.Text = "" Or Me.txtZimmerpreis.Text = "" Or Me.txtUebernachtungen.Text = "" Then Exit Sub
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Private Sub txtGesamtPreis_Change()
    If IsNumeric(txtGesamtPreis.Text) = False Then
        Me.txtGesamtPreis.Text = ""
        Exit Sub
    End If
    Me.cmdHotelrechnungDE.Enabled = True
    'Me.txtGesamtPreis.Tag = Me.txtGesamtPreis.Text
End Sub

Private Sub cmdHotelrechnungDE_Click()
    Call HotelabrechnungSpeichern
    Call ReportHotelabrechnung.BerichtHotelAbrechnung
    Me.cmdHotelrechnungDE.Enabled = False
End Sub
Private Sub cmdSchliessen_Click()
Dim Mldg, Stil, Titel, Hilfe, Ktxt, Antwort, Text1
Mldg = "Wenn Sie das Fenster schließen geht alles verloren." & Chr$(13) & "Möchten Sie es trotzdem schließen ?"   ' Meldung definieren.
Stil = vbYesNo + vbCritical + vbDefaultButton2   ' Schaltflächen
      ' definieren.
Titel = "MsgBox-Demonstration"   ' Titel definieren.
Hilfe = "DEMO.HLP"   ' Hilfedatei
      ' definieren.
Ktxt = 1000   ' Kontext für Thema
      ' definieren.
'Antwort = MsgBox(Mldg, Stil, Titel, Hilfe, Ktxt)   ' Meldung anzeigen.
If Me.cmdHotelrechnungDE.Enabled = True Then
    If MsgBox(Mldg, Stil, Titel, Hilfe, Ktxt) = vbNo Then
        Exit Sub
    End If
End If
Unload Me
End Sub

'............ PROZEDUREN .............

'---------Tabelle ReportKellnerBerichte abfragen-------------
Sub ComboZimmerNrFuellen()
    Dim objConn As ADODB.Connection
    Dim rsHotelpreisliste As ADODB.Recordset
    Set objConn = New ADODB.Connection
    Set rsHotelpreisliste = New ADODB.Recordset
    Dim strPath As String
    
    On Error GoTo err_Handler
    
    strPath = App.Path
    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
      
    With objConn
        .Provider = "Microsoft Jet 4.0 OLE DB Provider"
        .ConnectionString = "Data Source=" & VarDatenbank
        .CursorLocation = adUseClient
        .Open
    End With
    
    
    With rsHotelpreisliste
        .ActiveConnection = objConn
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open "Select ZimmerNr FROM Hotelpreisliste GROUP BY ZimmerNr"
    End With
     
    cmbZimmerNr.Clear
    cmbZimmerNr.AddItem ""
     
    While Not rsHotelpreisliste.EOF
        cmbZimmerNr.AddItem rsHotelpreisliste.Fields("ZimmerNr").Value
        rsHotelpreisliste.MoveNext
    Wend
    
    
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
exit_Sub:
      On Error GoTo 0
      Exit Sub
    
err_Handler:
      MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
                vbCritical, "Fehler"
        
      Resume exit_Sub
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
End Sub

Sub ComboZimmerArtFuellen(VarZimmerLokal)
    Dim objConn As ADODB.Connection
    Dim rsHotelpreisliste As ADODB.Recordset
    Set objConn = New ADODB.Connection
    Set rsHotelpreisliste = New ADODB.Recordset
    Dim strPath As String
    
    On Error GoTo err_Handler
    
    strPath = App.Path
    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
      
    With objConn
        .Provider = "Microsoft Jet 4.0 OLE DB Provider"
        .ConnectionString = "Data Source=" & VarDatenbank
        .CursorLocation = adUseClient
        .Open
    End With
    
    
    With rsHotelpreisliste
        .ActiveConnection = objConn
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open "Select *FROM Hotelpreisliste Where ZimmerNr = " & VarZimmerLokal & ""
    End With
     
    cmbZimmerArt.Clear
    cmbZimmerArt.AddItem ""
     
    While Not rsHotelpreisliste.EOF
        cmbZimmerArt.AddItem rsHotelpreisliste.Fields("Zimmerart").Value
        rsHotelpreisliste.MoveNext
    Wend
    cmbZimmerArt.Text = cmbZimmerArt.List(1)

    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
exit_Sub:
      On Error GoTo 0
      Exit Sub
    
err_Handler:
      MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
                vbCritical, "Fehler"
        
      Resume exit_Sub
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
End Sub

Sub ComboZimmerLeistungFuellen(VarZimmerNrLokal, VarZimmerArtLokal)
    Dim objConn As ADODB.Connection
    Dim rsHotelpreisliste As ADODB.Recordset
    Set objConn = New ADODB.Connection
    Set rsHotelpreisliste = New ADODB.Recordset
    Dim strPath As String
    
    On Error GoTo err_Handler
    
    strPath = App.Path
    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
      
    With objConn
        .Provider = "Microsoft Jet 4.0 OLE DB Provider"
        .ConnectionString = "Data Source=" & VarDatenbank
        .CursorLocation = adUseClient
        .Open
    End With
    
    
    With rsHotelpreisliste
        .ActiveConnection = objConn
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open "Select *FROM Hotelpreisliste Where ZimmerNr = " & VarZimmerNrLokal & " and Zimmerart = '" & VarZimmerArtLokal & "' "
    End With
     
    cmbZimmerLeistung.Clear
    cmbZimmerLeistung.AddItem ""
     
    For I = 4 To rsHotelpreisliste.Fields.Count - 1
        Me.cmbZimmerLeistung.AddItem rsHotelpreisliste.Fields(I).Name
    Next I
    
    cmbZimmerLeistung.Text = cmbZimmerLeistung.List(2)
    
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
exit_Sub:
      On Error GoTo 0
      Exit Sub
    
err_Handler:
      MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
                vbCritical, "Fehler"
        
      Resume exit_Sub
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
End Sub
Function ZimmerPreisAbfragen(VarZimmerNrLokal, VarZimmerArtLokal, VarZimmerLeistungLokal)
    Dim objConn As ADODB.Connection
    Dim rsHotelpreisliste As ADODB.Recordset
    Set objConn = New ADODB.Connection
    Set rsHotelpreisliste = New ADODB.Recordset
    Dim strPath As String
    
    On Error GoTo err_Handler
    
    strPath = App.Path
    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
      
    With objConn
        .Provider = "Microsoft Jet 4.0 OLE DB Provider"
        .ConnectionString = "Data Source=" & VarDatenbank
        .CursorLocation = adUseClient
        .Open
    End With

    With rsHotelpreisliste
        .ActiveConnection = objConn
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open "Select *FROM Hotelpreisliste Where ZimmerNr = " & VarZimmerNrLokal & " and Zimmerart = '" & VarZimmerArtLokal & "'"
    End With

    If Not IsNull(rsHotelpreisliste.Fields(VarZimmerLeistungLokal).Value) Then
        ZimmerPreisAbfragen = rsHotelpreisliste.Fields(VarZimmerLeistungLokal).Value
        Me.txtFruehstueckpreis = rsHotelpreisliste.Fields(VarZimmerLeistungLokal).Value - rsHotelpreisliste.Fields("Ü").Value
    Else
        ZimmerPreisAbfragen = 0
        Me.txtFruehstueckpreis = ""
    End If
    
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
exit_Sub:
      On Error GoTo 0
      Exit Function
    
err_Handler:
      MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
                vbCritical, "Fehler"
        
      Resume exit_Sub
    Set rsHotelpreisliste = Nothing
    Set objConn = Nothing
End Function
Sub AnsichtAktualisieren(VarZimmerNrLokal, VarZimmerArtLokal, VarZimmerLeistungLokal)
    'If VarZimmerNrLokal = Empty Or VarZimmerArtLokal = Empty Or VarZimmerLeistungLokal = Empty Then Exit Sub
    'If VarZimmerNrLokal = "" Or VarZimmerArtLokal = "" Or VarZimmerLeistungLokal = "" Then Exit Sub
    
    Me.txtUebernachtungen.Text = DTPickerEnddatum.Value - DTPickerStartdatum.Value
    
        Call Me.ComboZimmerNrFuellen
        Me.cmbZimmerNr.Text = VarZimmerNrLokal

        Call Me.ComboZimmerArtFuellen(VarZimmerNrLokal)
        Me.cmbZimmerArt.Text = VarZimmerArtLokal

        Call Me.ComboZimmerLeistungFuellen(VarZimmerNrLokal, VarZimmerArtLokal)
        Me.cmbZimmerLeistung.Text = VarZimmerLeistungLokal

    
    X = ZimmerPreisAbfragen(VarZimmerNrLokal, VarZimmerArtLokal, VarZimmerLeistungLokal)
    Me.txtZimmerpreis.Text = X
    Me.txtGesamtPreis.Text = Me.txtZimmerAnzahl.Text * Me.txtZimmerpreis.Text * Me.txtUebernachtungen.Text
End Sub
Sub HotelabrechnungSpeichern()
    Dim objConn As ADODB.Connection
    Dim rsHotelAbrechnungspeichern As ADODB.Recordset
    Set objConn = New ADODB.Connection
    Set rsHotelAbrechnungspeichern = New ADODB.Recordset
    Dim strPath As String
    
    On Error GoTo err_Handler
    
    strPath = App.Path
    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
      
    With objConn
        .Provider = "Microsoft Jet 4.0 OLE DB Provider"
        .ConnectionString = "Data Source=" & VarDatenbank
        .CursorLocation = adUseClient
        .Open
    End With
    
    
    With rsHotelAbrechnungspeichern
        .ActiveConnection = objConn
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open "Select *FROM AbrechnungHotel"
    End With
     
    
    rsHotelAbrechnungspeichern.AddNew
    rsHotelAbrechnungspeichern.Fields("Mitarbeiter").Value = "VarKellner"
    rsHotelAbrechnungspeichern.Fields("Datum").Value = Date
    rsHotelAbrechnungspeichern.Fields("Anreise").Value = Me.DTPickerStartdatum.Value
    rsHotelAbrechnungspeichern.Fields("Abreise").Value = Me.DTPickerEnddatum.Value
    rsHotelAbrechnungspeichern.Fields("ZimmerAnzahl").Value = Me.txtZimmerAnzahl.Text
    rsHotelAbrechnungspeichern.Fields("ZimmerNr").Value = Me.cmbZimmerNr.Text
    rsHotelAbrechnungspeichern.Fields("ZimmerArt").Value = Me.cmbZimmerArt.Text
    rsHotelAbrechnungspeichern.Fields("Zimmerleistung").Value = Me.cmbZimmerLeistung.Text

    
    VarUebernachtungen = Me.DTPickerEnddatum.Value - Me.DTPickerStartdatum.Value
    If Me.cmbZimmerNr.Text = "" Then
        rsHotelAbrechnungspeichern.Fields("TextUerbernachtungen").Value = VarUebernachtungen & " Ü ohne Frühstück "
    
    Else
       rsHotelAbrechnungspeichern.Fields("TextUerbernachtungen").Value = VarUebernachtungen & " Ü im " & Me.cmbZimmerArt.Text & " ohne Frühstück "
    End If

    rsHotelAbrechnungspeichern.Fields("TextFruehstueck").Value = VarUebernachtungen & " Frühstück "
    
    rsHotelAbrechnungspeichern.Fields("ZimmerEPÜ").Value = Me.txtZimmerpreis - Me.txtFruehstueckpreis.Text
    rsHotelAbrechnungspeichern.Fields("ZimmerEPÜF").Value = txtZimmerpreis.Text
    rsHotelAbrechnungspeichern.Fields("ZimmerEPF").Value = Me.txtFruehstueckpreis.Text
    
    rsHotelAbrechnungspeichern.Fields("ZimmerGPÜ").Value = VarUebernachtungen * (Me.txtZimmerpreis - Me.txtFruehstueckpreis.Text)
    rsHotelAbrechnungspeichern.Fields("ZimmerGPÜF").Value = VarUebernachtungen * txtZimmerpreis.Text
    rsHotelAbrechnungspeichern.Fields("ZimmerGPF").Value = VarUebernachtungen * Me.txtFruehstueckpreis.Text
    
    rsHotelAbrechnungspeichern.Fields("Gesamt").Value = Me.txtGesamtPreis.Text
    
    If frmTotal.Option1(0).Value = True Then
        rsHotelAbrechnungspeichern.Fields("BAR").Value = Me.txtGesamtPreis.Text
    ElseIf frmTotal.Option1(1).Value = True Then
        rsHotelAbrechnungspeichern.Fields("KARTE").Value = Me.txtGesamtPreis.Text
    ElseIf frmTotal.Option1(2).Value = True Then
        rsHotelAbrechnungspeichern.Fields("GUTSCHEIN").Value = Me.txtGesamtPreis.Text
    End If
    
    rsHotelAbrechnungspeichern.Update
    
    Set rsHotelAbrechnungspeichern = Nothing
    Set objConn = Nothing
exit_Sub:
      On Error GoTo 0
      Exit Sub
    
err_Handler:
      MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
                vbCritical, "Fehler"
        
      Resume exit_Sub
    Set rsHotelAbrechnungspeichern = Nothing
    Set objConn = Nothing
End Sub
    
