اجو كل من لديه علم من اهل خبرة المنتدى العريق ......
عندى برنامج مخازن عاوز اعدل فيه اختيارات الوحدة بدل (دستة وقطعة ) تكون زى ما انا عاوز :
مثلاً
كرتونة × 2.5 دستة
كيس × 3 دستة
وهكذا .......
الكود اهو :
Private Sub NoTaxUnitPrice_AfterUpdate()
Me![unitPrice] = Me![NoTaxUnitPrice] * (1 + [salesTax] / 100)
If Me![ProductUnitID].Column(1) = "دستة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
ElseIf Me![ProductUnitID].Column(1) = "قطعة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice] / 12
Else
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
End If
End Sub
Private Sub NoTaxUnitPrice_Click()
Me![unitPrice] = Me![NoTaxUnitPrice] * (1 + [salesTax] / 100)
If Me![ProductUnitID].Column(1) = "دستة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
ElseIf Me![ProductUnitID].Column(1) = "قطعة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice] / 12
Else
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
End If
End Sub
Private Sub ProductUnitID_AfterUpdate()
If Me![ProductUnitID].Column(1) = "قطعة" Then
Me![NoTaxUnitPrice] = Nz(Me![NoTaxOnePiecePrice]) * 12
'Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice] / 12
ElseIf Me![ProductUnitID].Column(1) = "دستة" Then
Me![NoTaxUnitPrice] = Me![NoTaxOnePiecePrice]
End If
Me![unitPrice] = Me![NoTaxUnitPrice] * (1 + [salesTax] / 100)
End Sub
Private Sub UnitsInStock_AfterUpdate()
Me![Dozens] = Me![unitsInStock] \ 12
Me![Pieces] = Me![unitsInStock] - Me![Dozens] * 12
If Me![ProductUnitID].Column(1) = "دستة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
ElseIf Me![ProductUnitID].Column(1) = "قطعة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice] / 12
Else
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
End If
End Sub
Private Sub UnitsInStock_BeforeUpdate(Cancel As Integer)
Me![Dozens] = Me![unitsInStock] \ 12
Me![Pieces] = Me![unitsInStock] - Me![Dozens] * 12
If Me![ProductUnitID].Column(1) = "دستة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
ElseIf Me![ProductUnitID].Column(1) = "قطعة" Then
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice] / 12
Else
Me![NoTaxOnePiecePrice] = Me![NoTaxUnitPrice]
End If
End Sub
وحاجة كمان البرنامج لما اجى اشغلة على اى جهاز .... بيسطبلى لغة غريبة اوى وكل ما احذفها من كنرول بانل ترجع لما ادخل على البرنامج .
انا عارف انى هلاقى الحل .... هنا