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

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

قام بنشر

السلام عليكم ورحمه الله وبركاته 

اخواني الكرام اريد تعديل هذا الكود بالطريقه الصحيحه

On Error Resume Next
Dim n As String: Dim i As Integer: Dim isopen As Boolean
n = "frmSales"
isopen = False
For i = 0 To Forms.Count - 1
If Forms(i).FormName = n Then
   isopen = True
End If
Next i
If isopen Then
    ' temp_MYn1 = Me.sfrm_Search!MYn1

    Select Case KeyCode
  
        Case vbKeyDown
   
        Case vbKeyUp
            
        Case vbKeyReturn
        
         '   Me.frm_Search_New.Form.RecordsetClone.FindFirst "[Rajmsanf]='" & Me.sfrm_Search_New!MYn1 & "'"

    
    DoCmd.OpenForm "frmEdrajSenf"
    Forms![frmEdrajSenf]![Rajmsanf] = Form.RecordsetClone!Rajmsanf
    Forms![frmEdrajSenf]![NaEMP] = Form.RecordsetClone!NaEMP
    Forms![frmEdrajSenf]![sarabaih] = Form.RecordsetClone!sarabaih
    DoCmd.close acForm, "frm_Search_New", acSaveNo
            
    End Select
       
Else
   
    
    Select Case KeyCode
  
        Case vbKeyDown
                    If KeyCode = vbKeyUp Then
    DoCmd.GoToRecord , , acPrevious
  End If
  
  If KeyCode = vbKeyDown Then
    DoCmd.GoToRecord , , acNext
  End If

   
        Case vbKeyUp
                If KeyCode = vbKeyUp Then
    DoCmd.GoToRecord , , acPrevious
  End If
  
  If KeyCode = vbKeyDown Then
    DoCmd.GoToRecord , , acNext
  End If
  Case vbKeyReturn
        
          '  Me.sfrm_Search.Form.RecordsetClone.FindFirst "[Rajmsanf]='" & Me.sfrm_Search!MYn1 & "'"

            DoCmd.OpenForm "frmEdrajSenf2"
            Forms![frmEdrajSenf2]![Rajmsanf] = Me.Rajmsanf
            Forms![frmEdrajSenf2]![NaEMP] = Me.NaEMP
            DoCmd.close acForm, "frm_Search_New", acSaveNo
      
          ' KeyCode = 0
            
    End Select
        
           
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