VERSION 5.00
Begin {78E93846-85FD-11D0-8487-00A0C90DC8A9} ReportKüche 
   Caption         =   "Bon"
   ClientHeight    =   10290
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   15120
   _ExtentX        =   26670
   _ExtentY        =   18150
   _Version        =   393216
   _DesignerVersion=   100684101
   ReportWidth     =   3800
   BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
      Name            =   "Arial"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   GridX           =   1
   GridY           =   1
   BottomMargin    =   200
   _Settings       =   23
   NumSections     =   5
   SectionCode0    =   1
   BeginProperty Section0 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Bereich4"
      Object.Height          =   1710
      NumControls     =   4
      ItemType0       =   3
      BeginProperty Item0 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "lblDruckerstation"
         Object.Width           =   3800
         Object.Height          =   390
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Object.Caption         =   "BonDrucker"
         Alignment       =   2
      EndProperty
      ItemType1       =   3
      BeginProperty Item1 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "lblDatum"
         Object.Top             =   420
         Object.Width           =   3800
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Object.Caption         =   "Datum"
         Alignment       =   2
      EndProperty
      ItemType2       =   3
      BeginProperty Item2 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "lblStationUNDTisch"
         Object.Top             =   1155
         Object.Width           =   3800
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Object.Caption         =   "StationUNDTisch"
         Alignment       =   2
      EndProperty
      ItemType3       =   3
      BeginProperty Item3 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "lblKellner"
         Object.Top             =   645
         Object.Width           =   3800
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Object.Caption         =   "Kellner"
         Alignment       =   2
      EndProperty
   EndProperty
   SectionCode1    =   2
   BeginProperty Section1 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Bereich2"
      Object.Height          =   30
      NumControls     =   0
   EndProperty
   SectionCode2    =   4
   BeginProperty Section2 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Bereich1"
      Object.Height          =   555
      NumControls     =   5
      ItemType0       =   4
      BeginProperty Item0 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "txtGericht"
         Object.Left            =   1155
         Object.Width           =   2265
         Object.Height          =   210
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         CanGrow         =   -1  'True
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1031
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType1       =   4
      BeginProperty Item1 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "txtSummeMenge"
         Object.Width           =   360
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Alignment       =   1
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1031
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType2       =   4
      BeginProperty Item2 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "txtSummeEPREIS"
         Object.Left            =   3255
         Object.Width           =   525
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Alignment       =   1
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   1
            Format          =   "#####0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1031
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType3       =   4
      BeginProperty Item3 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "txtPLU"
         Object.Left            =   585
         Object.Width           =   525
         Object.Height          =   225
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1031
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType4       =   5
      BeginProperty Item4 {1C13A8E3-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Linie1"
         Object.Top             =   375
         Object.Width           =   3800
      EndProperty
   EndProperty
   SectionCode3    =   7
   BeginProperty Section3 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Bereich3"
      Object.Height          =   330
      NumControls     =   0
   EndProperty
   SectionCode4    =   8
   BeginProperty Section4 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Bereich5"
      Object.Height          =   375
      NumControls     =   1
      ItemType0       =   3
      BeginProperty Item0 {1C13A8E1-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Bezeichnung1"
         Object.Left            =   1065
         Object.Top             =   30
         Object.Width           =   1515
         Object.Height          =   210
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BackColor       =   0
         Object.Caption         =   "***"
         Alignment       =   2
      EndProperty
   EndProperty
End
Attribute VB_Name = "ReportKüche"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Sub TischNeuesGericht(VarDrucker, VarBon)
Dim objConn As ADODB.Connection
Dim rsNeuesGericht As ADODB.Recordset
Dim strPath As String

Set objConn = New ADODB.Connection
Set rsNeuesGericht = New ADODB.Recordset

  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"
    .Properties("Jet OLEDB:Database Password") = VarPasswordDatenbank
    .ConnectionString = "Data Source=" & strPath & "asql.mdb"
    .CursorLocation = adUseClient
    .Open
  End With

   'Tabelle OffeneTische öffnen
   With rsNeuesGericht
     .ActiveConnection = objConn
     .CursorLocation = adUseClient
     .LockType = adLockOptimistic
     '.Open "Select Gericht,EPREIS As Einzelpreis,Sum(Menge) AS SummeMenge,Sum(Menge)*EPREIS As SummeBrutto from TischNeuesGericht Where Station = '" & VarStation & "' and Kellner='" & VarKellner & "' and Tisch='" & VarTisch & "' and Drucker='" & VarDrucker & "' Group by Gericht,EPREIS "
      .Open "Select PLU,Gericht,Menge_Text,GPREIS from OffeneTische Where Station = '" & VarStation & "' and Tisch='" & VarTisch & "' and Bondrucker='" & VarDrucker & "' and TischDetails ='Neu'"
   End With
 
 If rsNeuesGericht.EOF = True Then GoTo 10
 
While Not rsNeuesGericht.EOF
  If rsNeuesGericht.Fields("Gericht").Value = "Speise" Or rsNeuesGericht.Fields("Gericht").Value = "Getränke" Then
   ' rsNeuesGericht.Fields("Gericht").Value = Format(rsNeuesGericht.Fields("Einzelpreis").Value, "#####0.00")
  End If
 rsNeuesGericht.MoveNext
Wend
 
Set ReportKüche.DataSource = rsNeuesGericht
 
 
   ReportKüche.Sections("Bereich4").Controls("lblDruckerstation").Caption = VarBon
   ReportKüche.Sections("Bereich4").Controls("lblDatum").Caption = Now
   ReportKüche.Sections("Bereich4").Controls("lblStationUNDTisch").Caption = VarStation & "  -  " & "Tisch: " & VarTisch
   ReportKüche.Sections("Bereich4").Controls("lblKellner").Caption = "Kellner: " & VarKellner
   ReportKüche.Sections("Bereich1").Controls("txtGericht").DataField = rsNeuesGericht.Fields("Gericht").Name
   ReportKüche.Sections("Bereich1").Controls("txtSummeMenge").DataField = rsNeuesGericht.Fields("Menge_Text").Name
   ReportKüche.Sections("Bereich1").Controls("txtPLU").DataField = rsNeuesGericht.Fields("PLU").Name

   ReportKüche.Sections("Bereich1").Controls("txtSummeEPREIS").DataField = rsNeuesGericht.Fields("GPREIS").Name

 'ReportKüche.Show 1
 Me.PrintReport

10 Set objConn = Nothing
   Set rsNeuesGericht = Nothing


exit_Sub:
  On Error GoTo 0

Set rsNeuesGericht = Nothing
Set objConn = Nothing
  
  Exit Sub

err_Handler:
    MsgBox "Fehlernummer " & Err.Number & Chr$(13) & Error$(Err), _
            vbCritical, "Fehler"
    
  Resume exit_Sub

Set rsNeuesGericht = Nothing
Set objConn = Nothing

End Sub

