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

alhakeem1977

عضو جديد 01
  • Posts

    4
  • تاريخ الانضمام

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

كل منشورات العضو alhakeem1977

  1. السلام عليكم ورحمة الله وبركاته كيف يمكنني استخدام الكود الذي طرحته في هذه المقالة؟
  2. السلام عليكم اخواني Ms Access .واذا لقاها فارغة يقوم بالعملية Update عندي مشكلة كود يقوم بفحص قيمة ليست فارغة في حقل لجدول بين تاريخين , اذا حصل على قيمة ليست فارغة لا يقوم بعملية .هو الحقل المراد بأن يكون فارغا قبل الحذف واذا كان فارغا تتم العملية بنجاح SenderID txtDF بمعنى ما بعد التاريخ في النمزذج بإسم Criteria هو حقل ال DDate أرجوا من اخواني الاعزاء المساعدة شكرا جزيلا مقدما Private Sub cmdUpdate_Click() On Error GoTo errHandler On Error GoTo errHandler DoCmd.Save DoCmd.RunCommand acCmdSaveRecord DoCmd.RefreshRecord Me.txtStartDate.Requery Me.txtDF.Requery Beep Dim rs As Variant rs = DLookup("[SenderID]", "DeptSeq", "[DDate] >= #" & txtDF & "#") If Not IsNull(rs) Then MsgBox Prompt:="One or more ""Sent Dates"" exist in the date range selected for deletion.", buttons:=vbOKOnly, Title:="Can't Delete Dates with Sent Items" Else If IsNull(rs) Then If MsgBox("You are about to execute a major operation ! Do you really want to continue ?" & vbCrLf, vbYesNo, "Major Operation") = vbNo Then Undo MsgBox "Your operation execution is canceled !", vbOKOnly, "Operation Canceled" Else DoCmd.SetWarnings False DoCmd.OpenQuery "QryDelete", , acEdit DoCmd.SetWarnings True DoCmd.RunCommand acCmdRefresh DAOAdding On Error Resume Next MsgBox "Your operation execution is completed successfully.", vbOKOnly, "Successful Operation" End If End If End If ExitProc: Exit Sub errHandler: MsgBox Prompt:=Err & ": " & Err.Description, buttons:=vbOKOnly, Title:="Error" Resume End Sub
  3. السلام عليكم اخواني Ms Access عندي مشكلتين الأولى مس ماتش والثانية الكود في حالة البحث عن السجل السابق يرجع لأول سجل فقط وليس للسجل نفسه لمنع تكرار ثلاثة حقول مختلفة ومجتمعة اذا اختلف واحد منها تصبح مقبولة وهي كالآتي حقل تكست حقل تاريخ حقل تكست Private Sub txtDocumentName_AfterUpdate() Dim NewAccountNo As String Dim NewDocumentName As String Dim NewDocumentDate As Date Dim stLinkCriteria As String Dim DocNo As Integer 'Assign the entered customer name, Date and address to a variable NewAccountNo = Me.AccountNo.Value NewDocumentDate = Me.DocumentDate.Value NewDocumentName = Me.DocumentName.Value stLinkCriteria = "[AccountNo] = '" & Me.cboAccountNo & _ "' And [DocumentDate] = '" & Me.txtDocumentDate & _ "' And [DocumentName] = '" & Me.txtDocumentName & "'" If Me.AccountNo = DLookup("[AccountNo]", "tblFacilityRegister", stLinkCriteria) Then MsgBox "This Account, " & NewAccountNo & ", has already been entered in database." _ & vbCr & vbCr & "with DocumentDate " & NewDocumentDate & "" _ & vbCr & vbCr & "with DocumentName " & NewDocumentName & "" _ & vbCr & vbCr & "Press OK to lead you to the previous record.", vbInformation, "Duplicate information" Me.Undo 'undo the process and clear all fields Me.Save.Enabled = False 'show the record of matched customer name and address from the customer table DocNo = DLookup("[DocNo]", "tblFacilityRegister", stLinkCriteria) Me.DataEntry = False DoCmd.FindRecord DocNo, , , , , acCurrent End If End Sub
×
×
  • اضف...

Important Information