Hallo Andre,
ok, also da dürfte nur das alles im Code stehen?
Code:
Option Explicit
Private Sub UserForm_Activate()
Dim i As Integer, lngz As Long
Dim arr1 As Variant
Dim D1 As Object, D2 As Object, D3 As Object
Set D1 = CreateObject("Scripting.Dictionary")
Set D2 = CreateObject("Scripting.Dictionary")
Set D3 = CreateObject("Scripting.Dictionary")
With Sheets("Bestellübersicht")
lngz = .Cells(.Rows.Count, 1).End(xlUp).Row
arr1 = .Range("A2:E" & lngz)
D1("bitte wählen") = "bitte wählen"
D2("bitte wählen") = "bitte wählen"
D3("bitte wählen") = "bitte wählen"
For i = 2 To UBound(arr1)
D1(CStr(RTrim(arr1(i, 1)))) = 0
D2(arr1(i, 5)) = 0
D3(arr1(i, 2)) = 0
Next i
End With
If D1.Count > 0 Then
Me.ComboBox1.List = Application.Transpose(D1.Keys)
Me.ComboBox1.ListIndex = 0
Me.ComboBox1.SelLength = Len(Me.ComboBox1.Text)
boVar = True
Me.ComboBox2.List = Application.Transpose(D2.Keys)
Me.ComboBox2.ListIndex = 0
Me.ComboBox2.SelLength = Len(Me.ComboBox2.Text)
boVar = False
Me.ComboBox3.List = Application.Transpose(D3.Keys)
Me.ComboBox3.ListIndex = 0
Me.ComboBox3.SelLength = Len(Me.ComboBox3.Text)
boVar = False
End If
End Sub
Sub combo1_füllen()
Dim i As Integer, lngz As Long
Dim arr1 As Variant
Dim D1 As Object, D2 As Object, D3 As Object
Set D1 = CreateObject("Scripting.Dictionary")
Set D2 = CreateObject("Scripting.Dictionary")
Set D3 = CreateObject("Scripting.Dictionary")
With Sheets("Bestellübersicht")
lngz = .Cells(.Rows.Count, 1).End(xlUp).Row
arr1 = .Range("A2:E" & lngz)
D1("bitte wählen") = "bitte wählen"
D2("bitte wählen") = "bitte wählen"
D3("bitte wählen") = "bitte wählen"
For i = 2 To UBound(arr1)
If arr1(i, 5) = Me.ComboBox2.Text Then
D1(CStr(RTrim(arr1(i, 1)))) = 0
End If
Next i
End With
If D1.Count > 0 Then
Me.ComboBox1.List = Application.Transpose(D1.Keys)
Me.ComboBox1.ListIndex = 0
Me.ComboBox1.SelLength = Len(Me.ComboBox1.Text)
boVar = True
End If
End Sub
Sub combo3_füllen()
Dim i As Integer, lngz As Long
Dim arr1 As Variant
Dim D1 As Object, D2 As Object, D3 As Object
Set D1 = CreateObject("Scripting.Dictionary")
Set D2 = CreateObject("Scripting.Dictionary")
Set D3 = CreateObject("Scripting.Dictionary")
With Sheets("Bestellübersicht")
lngz = .Cells(.Rows.Count, 1).End(xlUp).Row
arr1 = .Range("A2:E" & lngz)
D1("bitte wählen") = "bitte wählen"
D2("bitte wählen") = "bitte wählen"
D3("bitte wählen") = "bitte wählen"
For i = 2 To UBound(arr1)
If arr1(i, 1) = Me.ComboBox1.Text And arr1(i, 5) = Me.ComboBox2.Text Then
D1(CStr(RTrim(arr1(i, 2)))) = 0
End If
Next i
End With
If D1.Count > 0 Then
Me.ComboBox3.List = Application.Transpose(D1.Keys)
Me.ComboBox3.ListIndex = 0
Me.ComboBox3.SelLength = Len(Me.ComboBox1.Text)
boVar = True
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
ist das richtig so?
Hast du hier den Beitrag von Atilla gesehen, das ich in der Form, "frmLieferungen" eine zusätzliche TextBox ein geben kann und dort meine Bemerkungen speichern kann?
Das habe ich gemacht und meine Maske etwas abgeändert, in der ich nach dem Artikelstatus suchen (anzeigen)möchte.
Also werden über die Form Lieferungen suchen/buchen, die Bemerkungen geschrieben und abgespeichert.
Jetzt brauche ich nur noch einen einfachen Aufruf aus der Maske, die ich etwas abgeändert habe, zum suchen nach Bestellnummer und Artikelnummer, das er mir zu dem Artikel den gespeicherten Lieferstatus anzeigt
Sie das neue Bild, das ich nach Atillas Beitrag von der Maske hier rein gesetzt habe.
Grüße Mike