اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

تحويل بين الوحدات


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

بالله عليكم ساعدوني في حل المشكلة

وجدت مثال للتجويل بين الوحدات ومعرفة الرصيد كرتونة ودرزينة وقطعة

New Microsoft Office Access Application (2)_2.rar

Public Function UnitsDtls(AllUnits As Integer, BoxPockets As Integer, PocketContain As Integer, MyChoice As Byte)

'   AllUnits تمثل إجمالي القطع
'   BoxPockets عدد الدرزينات في الكرتون الواحد
'   PocketContain عدد القطع في كل درزينة أو وحدة فرعية
'   MyChoice تحدد أحد الخيارات 1-عدد الكراتين   2-عدد الوحدات الفرعية (الدرزينات)   3-عدد القطع المفردة
'

Dim BoxContain As Integer   'محتوى الكرتون من الوحدات
Dim BoxCnt As Integer   'عدد الكراتين
Dim PocketsCnt As Integer   'عدد الدرزينات
Dim UnitsCnt As Integer 'عدد الوحدات المفردة

BoxContain = (BoxPockets * PocketContain)
BoxCnt = Int(AllUnits / BoxContain)
PocketsCnt = ((((AllUnits / BoxContain) - BoxCnt) * BoxContain) / PocketContain)
                    '336        144             2       144         12
UnitsCnt = (((AllUnits / BoxContain) - BoxCnt) * BoxContain) Mod PocketContain


Select Case MyChoice
Case Is = 1
UnitsDtls = BoxCnt
Case Is = 2
UnitsDtls = PocketsCnt
Case Is = 3
UnitsDtls = UnitsCnt
Case Else
UnitsDtls = -1
End Select

End Function

ويوجد خطأ في التحويل

واذا غيرت السطر

PocketsCnt = ((((AllUnits / BoxContain) - BoxCnt) * BoxContain) / PocketContain)

الى

PocketsCnt = Int((((AllUnits / BoxContain) - BoxCnt) * BoxContain) / PocketContain)

تظهر مشكلة في الصنف الاخر

002.png.cc2c2d00f0018244825567400f3b2700.png

 

001.png.250f9f34fbfeffc493b79852dc378122.png

 

 

002.png

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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

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

Important Information