alhakeem1977 قام بنشر يونيو 21, 2017 قام بنشر يونيو 21, 2017 السلام عليكم اخواني 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
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.