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

مشكلة كود يقوم بفحص قيمة ليست فارغة في حقل بين تاريخين


alhakeem1977

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

السلام عليكم اخواني

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

 

 


 

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

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