laatzen/Pruef2000/source/frmPrüfpunkteTest.frm
2021-10-01 11:11:04 +02:00

130 lines
4.0 KiB
Plaintext

VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmPrüfpunkteTest
Caption = "Form1"
ClientHeight = 7665
ClientLeft = 60
ClientTop = 345
ClientWidth = 15090
LinkTopic = "Form1"
ScaleHeight = 7665
ScaleWidth = 15090
StartUpPosition = 3 'Windows-Standard
Begin VB.CommandButton cmdStartTest
Caption = "Test"
Height = 495
Left = 480
TabIndex = 1
Top = 6360
Width = 1095
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 5895
Left = 120
TabIndex = 0
Top = 120
Width = 13815
_ExtentX = 24368
_ExtentY = 10398
_Version = 393216
End
Begin VB.Label lblAutosize
BorderStyle = 1 'Fest Einfach
Caption = "Label1"
Height = 255
Left = 14040
TabIndex = 2
Top = 720
Width = 855
End
End
Attribute VB_Name = "frmPrüfpunkteTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim m_abbruch As Boolean
Private Sub cmdStartTest_Click()
Dim rs As CRecordset
Dim strSQL As String
Dim strTemp As String
m_abbruch = False
On Error GoTo Errorhandler
Dim lngSerienNr As Long
strSQL = "SELECT distinct AlleAuftragPositionen.AuftragNr, AlleAuftragPositionen.PositionNr , AlleAuftragPositionen.SerienNrVon , AuftragPositionSerienNr.AnlageDatum "
strSQL = strSQL & " from AlleAuftragPositionen "
strSQL = strSQL & " inner join AuftragPositionSerienNr "
strSQL = strSQL & " on AlleAuftragPositionen.AuftragNr = AuftragPositionSerienNr.AuftragNr "
strSQL = strSQL & " and AlleAuftragPositionen.PositionNr = AuftragPositionSerienNr.PositionNr "
strSQL = strSQL & " and AuftragPositionSerienNr.SerienNr = AlleAuftragPositionen.SerienNrVon "
strSQL = strSQL & " and AuftragPositionSerienNr.Wiederholungen = 0 and SerienNrVon > 0 "
strSQL = strSQL & " inner join Identnr on AlleAuftragPositionen.IdentNr = Identnr.IdentNr "
strSQL = strSQL & " Where IdentNr.VakoCode is not null "
strSQL = strSQL & " order by AuftragPositionSerienNr.AnlageDatum desc "
Debug.Print strSQL
MSFlexGrid1.FormatString = "SerienNr|Qs|Info"
Set rs = New CRecordset
rs.openRS strSQL, True
Do While Not rs.EOF
lngSerienNr = rs.getLongValue("SerienNrVon")
MSFlexGrid1.AddItem lngSerienNr
MSFlexGrid1.row = MSFlexGrid1.Rows - 1
Dim Pruefzaehler As CPruefzaehler
Set Pruefzaehler = New CPruefzaehler
MSFlexGrid1.col = 1
If m_abbruch Then Exit Sub
If Pruefzaehler.loadForSerienNr(lngSerienNr) Then
Dim i As Integer
strTemp = ""
If Pruefzaehler.getPruefpunkte.getPruefpunkte Is Nothing Then
MSFlexGrid1.text = "-"
Else
For i = 1 To Pruefzaehler.getPruefpunkte.getPruefpunkte.Count
strTemp = strTemp & Pruefzaehler.getPruefpunkte.getPruefpunkt(i).getQ & " "
Next
MSFlexGrid1.text = strTemp
End If
MSFlexGrid1.col = 2
MSFlexGrid1.text = Pruefzaehler.m_strPruefpunktInfo
Else
MSFlexGrid1.text = "ERR"
End If
AutoSpaltenBreite MSFlexGrid1, lblAutosize
DoEvents
rs.MoveNext
Loop
Exit Sub
Errorhandler:
MsgBox "Fehler " & Err.Number & " " & Err.Description
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
m_abbruch = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
m_abbruch = True
End Sub