اذهب الي المحتوي
أوفيسنا

برنامج مخزون


إذهب إلى أفضل إجابة Solved by محمد هشام.,

الردود الموصى بها

صباح الخير عليكم جميعا

Private Sub rayon_vente_Exit(ByVal Cancel As MSForms.ReturnBoolean) 'vente
  Dim i As Long, monproduit, lig As Integer
  If ctrl = True Then Exit Sub
  If Me.rayon_vente.ListIndex = -1 Then
     If [T_listrayon].Item(1, 1) = "" Then lig = 1 Else lig = [T_listrayon].Rows.Count + 1
     [T_listrayon].Item(lig, 1) = Me.rayon_vente
     tbl = [T_listrayon].Value
     Tri tbl, LBound(tbl), UBound(tbl), 1
     Me.Rayon.list = tbl
     Me.rayon_vente.list = tbl
  End If
 'Me.produit_vente.Clear
  monproduit = [Produits].Value
  For i = 1 To UBound(monproduit)
    If monproduit(i, 2) = Me.rayon_vente Then
      Me.produit_vente.AddItem monproduit(i, 3)
      Me.produit_vente.list(Me.produit_vente.ListCount - 1, 1) = i
      Me.ComboBox4.AddItem monproduit(i, 11)
      Me.ComboBox4.list(Me.ComboBox4.ListCount - 1, 1) = i
    End If
  Next i
 ' Me.ComboBox4.Clear
 
  'Me.prix_vente = "": Me.stock_vente = "": Me.TVAvente = "": Me.quantite_vente = ""
End Sub

عند تختار اسم الصنف من الكومبوبوكس يوجد فراغ فى القائمة المنسدلة

فما سبب المشكلة

Gest_magasin.xlsm

رابط هذا التعليق
شارك

  • أفضل إجابة

السبب هو الصفوف الفارغة الموجودة اسفل الجدول  

 حاول اعادة تسمية النطاق بالشكل التالي

=OFFSET(Produits!$N$2;;;COUNTA(Produits!$N:$N)-1)

ووضع هدا الكود في موديول 

Sub Delete()
    Dim i As Long
    On Error Resume Next
    Application.ScreenUpdating = False
    With Worksheets("Produits").ListObjects("T_listrayon")
        For i = .ListRows.Count To 1 Step -1
            If .ListRows(i).Range.Cells(1) = "" Then
                .ListRows(i).Delete
            End If
        Next i
    End With
    Application.ScreenUpdating = True
End Sub

 

 

Sub afformulaire()
On Error Resume Next
Call Delete
Sheets("ACCUEIL").Activate: Formulaire.MultiPage1.Value = 0: Formulaire.Show modal
End Sub

 

Gest_magasin2.xlsm

رابط هذا التعليق
شارك

هذا صحيح ا / محمد هشام

Private Sub UserForm_Initialize()
  Dim c As Object, AL As Object, i As Long, d As Object
    tbl = [T_listrayon].Value '****************** Produits
    Tri tbl, LBound(tbl), UBound(tbl), 1
    Me.Rayon.list = tbl
    Me.rayon_vente.list = tbl
    tbl = [Client].Value '****************** Clients
    Tri tbl, LBound(tbl), UBound(tbl), 3
    Me.Recherche.list = tbl
    Me.nom_vente.list = tbl
    tbl = [T_Fournisseur].Value '****************** Fournisseur
    Tri tbl, LBound(tbl), UBound(tbl), 2
    Me.cherche_fournisseur.list = tbl
    Me.fournisseur.list = tbl
    Me.max_fournisseur = [T_Fournisseur].Rows.Count + 1
    Me.Scrollfournisseur.Max = Me.max_fournisseur
    Me.derenrg = [Produits].Rows.Count + 1
    Me.Scrollproduit.Max = Me.derenrg
    Me.derclient = [Client].Rows.Count + 1
    Me.ScrollClients.Max = Me.derclient
    Me.TxtDate = Format(Date, "dd/mm/yyyy")
End Sub

Private Sub produit_vente_Change() 'vente
Dim rep As Byte
  If Me.produit_vente.ListIndex = -1 And Me.produit_vente = "" Then Exit Sub
  If Me.produit_vente.ListIndex = -1 And Me.produit_vente <> "" Then
    rep = MsgBox("Le produit doit être créé avec la page produit", vbCritical, "Contrôle")
    Exit Sub
  End If
  Me.enrgproduit = Me.produit_vente.Column(1)
  enreg = Val(Me.enrgproduit.Value)
  Me.stock_vente = [Produits].Item(enreg, 4)
  Me.TVAvente = [Produits].Item(enreg, 6)
  Me.prix_vente = Format([Produits].Item(enreg, 8), "#,##0.00")
  Me.mini_vente = [Produits].Item(enreg, 10)
  ComboBox4 = [Produits].Item(enreg, 11)
End Sub


رأيت هذا
عندما أنقر على القائمة المنسدلة (product_sale)، يؤدي ذلك إلى زيادة المساحة في محتوى الورقة المخصصة لها

ما هو الخطأ في الكود؟

95510_6611b6eb176e8651742508.jpg

رابط هذا التعليق
شارك

من فضلك سجل دخول لتتمكن من التعليق

ستتمكن من اضافه تعليقات بعد التسجيل



سجل دخولك الان
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information