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

ابو ياسين المشولي

الخبراء
  • Posts

    1,752
  • تاريخ الانضمام

  • تاريخ اخر زياره

  • Days Won

    24

كل منشورات العضو ابو ياسين المشولي

  1. اقتراح بكود الترقيم Me.sconame.Value = Nz(DMax("[sconame]", "Querytbl2"), 0) + 1
  2. شوف هذا الكود انا متاكد ميه في الميه انه سليم Dim sql As String On Error GoTo MsgErr If DCount("[ItemCode]", "[InvoiceTT]", "[InvoiceCode]=" & Me.InvoiceCode & "and [ItemCode]=" & Me.ItemCode) > 0 Then sql = "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE (([InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB]<=[InvoiceTT]![QSold]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceHF1].[Form]![InvoiceNum]) AND ((InvoiceTT.CustCode)=[Forms]![InvoiceHFB]![InvoiceHF1].[Form]![CustCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql1 = "UPDATE [InvoiceTT] SET [InvoiceTT].Total1 = [InvoiceTT]![Total1]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![Total1] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql2 = "UPDATE [InvoiceTT] SET [InvoiceTT].OppB = [InvoiceTT]![OppB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![OppB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql3 = "UPDATE [InvoiceTT] SET [InvoiceTT].TaxB = [InvoiceTT]![TaxB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![TaxB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql4 = "UPDATE [InvoiceTT] SET [InvoiceTT].Paid1 = [InvoiceTT]![Paid1]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![Paid1] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql5 = "UPDATE [ItemsT] SET [ItemsT].QAvilable = [ItemsT]![QAvilable]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([ItemsT].ItemId)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" ولكي تتاكد ضع هذا الكود في حدث بعد التحديث لكميه المرتجع DoCmd.RunSQL "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE (([InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB]<=[InvoiceTT]![QSold]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceHF1].[Form]![InvoiceNum]) AND ((InvoiceTT.CustCode)=[Forms]![InvoiceHFB]![InvoiceHF1].[Form]![CustCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));"
  3. ايش طلع عندك ممكن تصور فيديو بالعمليه وشرح المطلوب
  4. لاحظ اسم حقل كمية البيع بالنموذج الفرع اسمها Text209 وليست QSold
  5. انت صاحب الموضوع انا ماتطلع عندي انا كمان مثلك مش عارف هههههههههههه
  6. بعد الفحص جرب هذا Dim sql As String On Error GoTo MsgErr If DCount("[ItemCode]", "[InvoiceTT]", "[InvoiceCode]=" & Me.InvoiceCode & "and [ItemCode]=" & Me.ItemCode) > 0 Then sql = "If DCount("[ItemCode]", "[InvoiceTT]", "[InvoiceCode]=" & Me.InvoiceCode & "and [ItemCode]=" & Me.ItemCode) > 0 Then sql = "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE ((([InvoiceTT]![QCB])<=[Forms]![InvoiceHFB]![InvoiceHF1].[Form]![Text209]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql1 = "UPDATE [InvoiceTT] SET [InvoiceTT].Total1 = [InvoiceTT]![Total1]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![Total1] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql2 = "UPDATE [InvoiceTT] SET [InvoiceTT].OppB = [InvoiceTT]![OppB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![OppB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql5 = "UPDATE [ItemsT] SET [ItemsT].QAvilable = [ItemsT]![QAvilable]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([ItemsT].ItemId)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));"
  7. نعم ولكن غير موجده بالنموذج كمية البيع لذلك هو ما يقدر يطبق الشرط شوف هذا التعديل اذا نفع بيكون ممتاز عملت له بشرط يكون نوع الفاتورة بيع sql = "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE ((([InvoiceTT]![QCB])<=[InvoiceTT]![QSold]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]) AND ([InvoiceTT]![MovementType]=""بيع""));"
  8. شوف انا اضفنا له شرط نوع السند يكون بيع sql = "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE ((([InvoiceTT]![QCB])<=[InvoiceTT]![QSold]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]) AND ([InvoiceTT]![MovementType]=""ÈíÚ""));" اخي لو تشرحلي الجداول بيكون افضل انا عملت هيك حسب الشرط بعتبار ان كميه البيع موجودة بالجدول وكان الشرط ان المرتجع اصغر او يساوي كميه البيع وهذا اضنه صحيح
  9. ممكن تعطني متر الاسم التاريخ الطول ماهو بالكردي
  10. جرب الان لعلي اخطائت Dim sql As String On Error GoTo MsgErr If DCount("[ItemCode]", "[InvoiceTT]", "[InvoiceCode]=" & Me.InvoiceCode & "and [ItemCode]=" & Me.ItemCode) > 0 Then sql = "UPDATE InvoiceTT SET InvoiceTT.QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] " & vbCrLf & _ "WHERE (([InvoiceTT]![QCB]<=[InvoiceTT]![QSold]) AND ((InvoiceTT.InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND ((InvoiceTT.ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql1 = "UPDATE [InvoiceTT] SET [InvoiceTT].Total1 = [InvoiceTT]![Total1]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![Total1] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql2 = "UPDATE [InvoiceTT] SET [InvoiceTT].OppB = [InvoiceTT]![OppB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![OppB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql5 = "UPDATE [ItemsT] SET [ItemsT].QAvilable = [ItemsT]![QAvilable]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([ItemsT].ItemId)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" fatoraedit123.accdb
  11. اخي ثبت اللغه بالجهاز بنظام وندوز وخليها الافتراضيه وحاول لعله يكون هو طلبك
  12. مشاركة مع اخي ابا جودي شوف المرفق وبشر بالنتيجه عدل بهذا كي يعمل بنظام 32 او 64 #If VBA7 Then Public Function InputBoxDK(Prompt, Optional Title, Optional Default, Optional XPos, _ Optional YPos, Optional HelpFile, Optional Context) As String Dim lngModHwnd As Long, lngThreadID As Long lngThreadID = GetCurrentThreadId lngModHwnd = GetModuleHandle(vbNullString) hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID) InputBoxDK = InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context) UnhookWindowsHookEx hHook #ElseIf Win64 Then Public Function InputBoxDK(Prompt, Optional Title, Optional Default, Optional XPos, _ Optional YPos, Optional HelpFile, Optional Context) As String Dim lngModHwnd As Long, lngThreadID As LongPtr lngThreadID = GetCurrentThreadId lngModHwnd = GetModuleHandle(vbNullString) hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID) InputBoxDK = InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context) UnhookWindowsHookEx hHook #Else '32-bit Office Public Function InputBoxDK(Prompt, Optional Title, Optional Default, Optional XPos, _ Optional YPos, Optional HelpFile, Optional Context) As String Dim lngModHwnd As Long, lngThreadID As Long lngThreadID = GetCurrentThreadId lngModHwnd = GetModuleHandle(vbNullString) hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID) InputBoxDK = InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context) UnhookWindowsHookEx hHook #End If End Function اخفاء الرقم السري .accdb
  13. هلا بك اخي انظر للاستعلام وبتعرف شو صأر
  14. ولماذا الاستاذان كلنا نعمل لوجه الله والكل يساعد الاخر
  15. احسنت كان خطاء مطبعي مني New Microsoft Access قاعدة بيانات (3) (1).accdb
  16. كلامك صح وهذا حسب طلب السائل If Me.t1.Caption <> BFEBFBFF000406E3 Then MsgBox "يوجد خطاء", vbInformation, "تنبيه" DoCmd.Quit End If New Microsoft Access قاعدة بيانات (3) (1).accdb
  17. حاول تصغر تقرير الطباعه حسب المقاس
×
×
  • اضف...

Important Information