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

مساعدة في منع تكرار الاسم في الحقول


إذهب إلى أفضل إجابة Solved by husamwahab,

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

السلام عليكم عندي نموذج testuF يحتوي حقل viruseid1 كيف امنع تكرار الاسم في الحقول وايضا عند اختيار الاسم في حقل viruseid1 وكان مربع التحرير   ROOM 

= X اوY1 تكون قيمة الحقل virusM = قيمة الحقل virusT  وبخلافة تكون قيمة الحقل 

virusM =قيمة الحقل virusL

TEST.accdb

tempsnip.png

تم تعديل بواسطه ازهر عبد العزيز
رابط هذا التعليق
شارك

الاستاذ الغالي husamwahab احسنت زادك الله علما  لو تكرمت ممكن دمج هذين الكودين معا في كود واحد 

Private Sub viruseid1_AfterUpdate()
If Forms!testuf!txtRoom = "x" Or Forms!testuf!txtRoom = "y1" Then
  Me.viruseM = Me.virusT
Else
  Me.viruseM = Me.virusL
End If
End Sub

>>>>

On Error Resume Next
    If Me.NewRecord = True Then
    Dim strWhere As String, strMessage As String
    strWhere = "[idViruses] = '" & Me![viruseid] & "'"
    Me.RecordsetClone.MoveFirst
    Me.RecordsetClone.FindFirst strWhere
    If Me.RecordsetClone.NoMatch = False Then
        strMessage = "The name of the virus is duplicate"
        lResponse = MsgBox(strMessage, vbOKOnly + vbCritical)
            If lResponse = vbOK Then
                Cancel = True
                Me.Undo
                Me.Bookmark = Me.RecordsetClone.Bookmark
            End If
    End If
End If

 

تم تعديل بواسطه ازهر عبد العزيز
رابط هذا التعليق
شارك

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