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

مساعدة في دمج كودين معا


إذهب إلى أفضل إجابة Solved by ازهر عبد العزيز,

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

السلام عليكم 

احتاج ان ادمج الكودين معا في كود واحد والتعديل على الكود ان وجد 

الكود  الاول 

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