Gruppe
Dialog
Problem
Über die Schaltfläche soll ein XL5-Dialog aufgerufen werden. Bei Eingabe einer Artikel-Nummer in ein Editfeld soll eine Bezeichnungsfeld die Artikelbenennung anzeigen.
StandardModule: Modul1
Sub ArtikelEintrag()
Dim oEdt As EditBox
Dim vRow As Variant
With ActiveDialog
Set oEdt = .EditBoxes("edtNumber")
If Len(oEdt.Text) = 6 Then
vRow = Application.Match(oEdt.Text, Columns(1), 0)
If IsError(vRow) Then
MsgBox "Artikelnummer wurde nicht gefunden!"
oEdt.Text = ""
Else
.Labels("lblItem").Caption = Cells(vRow, 2).Value
End If
End If
End With
End Sub
Sub CallForm()
Dim iRow As Integer
iRow = 2
With DialogSheets("dlgArtikel")
.EditBoxes("edtNumber").Text = ""
.Labels("lblItem").Caption = ""
.DropDowns("dpdNumber").ListIndex = 0
Do Until IsEmpty(Cells(iRow, 1))
.DropDowns("dpdNumber").AddItem Cells(iRow, 2).Value
iRow = iRow + 1
Loop
.Show
End With
End Sub
Sub ArtikelAuswahl()
Dim oDpd As DropDown
Dim vRow As Variant
With ActiveDialog
Set oDpd = .DropDowns("dpdNumber")
.Labels("lblItem").Caption = oDpd.List(oDpd.ListIndex)
End With
End Sub