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

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

قام بنشر

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

اريد هذا كود ترجع على الحفظ اوتعديل  ----- ارجوا افادة

On Error GoTo Err_traghh_Click
 DoCmd.SetWarnings False
Me.Job_ID.SetFocus
If Me.flagsav = 1 And (IsNull(Me.Job_ID)) Then
If MsgBox("åá ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÓÌíá ÇáÈíÇäÇÊ ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
Exit Sub
Else
Me.flagsav = Null
Me.Refresh
Me.Requery
Me.OrderByOn = True
Me.OrderBy = "[Job_ID] DESC"
   End If
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÓÌíá  ÈäÌÇÍ.", 48, " "
End If
If (Not IsNull([Job_ID]) And Not IsNull(Me.flagsav) And (Me.flagsav = 1)) Then
If MsgBox("åá ÊÑíÏ ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÓÌíá ÇáÈíÇäÇÊ ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
 Exit Sub
Else
On Error Resume Next
With Me
.AllowDeletions = True
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRefresh
Me.Requery
Me.Refresh
DoCmd.SetWarnings True
.AllowDeletions = False
.AllowEdits = True
Me.OrderByOn = True
Me.OrderBy = "[Job_ID] DESC"
End With
   End If
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÓÌíá  ÈäÌÇÍ.", 48, " "
End If
If Me.flagsav = 2 Then
If MsgBox("åá ÊÑíÏ ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÚÏíá ÇáÈíÇäÇÊ   ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
   Exit Sub
   Else
   End If
Me.Refresh
With Me
.AllowEdits = True
End With
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÚÏíá ÈäÌÇÍ.", 48, " "
  DoCmd.RunSQL "UPDATE EMPLOYEES INNER JOIN EMPLOYEES_Temp ON EMPLOYEES.Job_ID = EMPLOYEES_Temp.Job_ID SET Cars_ machinery.Job_ID = [EMPLOYEES_Temp]![Job_ID], EMPLOYEES.ID_cant = [EMPLOYEES_Temp]![Vehicle Type],Cars_ machinery.Vehicle Type = [EMPLOYEES_Temp]![Vehicle Type];"
  DoCmd.RunSQL "UPDATE Tabl_2 INNER JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id SET Tabl_2.FName = [Tabl_2_Temp]![FName], Tabl_2.Kinship = [Tabl_2_Temp]![Kinship];"
  DoCmd.RunSQL "DELETE Tabl_2.*, Tabl_2.Nn_Id, Tabl_2_Temp.B_id " & _
" FROM Tabl_2 LEFT JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id " & _
" WHERE (((Tabl_2.Nn_Id)=[Forms]![frm_F]![N_id]) AND ((Tabl_2_Temp.B_id) Is Null));"
 DoCmd.RunSQL "INSERT INTO Tabl_2 " & _
" SELECT Tabl_2_Temp.* " & _
" FROM Tabl_2 RIGHT JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id " & _
" WHERE (((Tabl_2.B_id) Is Null) AND ((Tabl_2_Temp.Nn_Id)=[Forms]![frm_F]![N_id]));"
  End If
On Error Resume Next
AllowAdditions = False
AllowEdits = False
AllowDeletions = False
On Error GoTo 0
Me![cmdNext].Enabled = True
Me![cmdPrevious].Enabled = True
Me![cmdLast].Enabled = True
Me![cmdFirst].Enabled = True
Me![D_L].Enabled = True
Me![seva].Enabled = False
Me![cmdClose].Enabled = True
Me![addnew].Enabled = True
Me![Edit].Enabled = True
Me![traghh].Enabled = False
If DCount("*", "EMPLOYEES", "Job_ID") < 1 Then
Me![addnew].Enabled = True
Me![cmdNext].Enabled = False
Me![cmdPrevious].Enabled = False
Me![cmdLast].Enabled = False
Me![cmdFirst].Enabled = Fals
Me![D_L].Enabled = False
Me![cmdcols].Enabled = True
Me![Edit].Enabled = False
Me![sav].Enabled = False
Me![traghh].Enabled = False
AllowAdditions = True
AllowEdits = False
AllowDeletions = False
End If
Me.flagsav = Null
Me.traghh.Caption = ""
DoCmd.SetWarnings True
Exit_traghh_Click:
    Exit Sub
Err_traghh_Click:
MsgBox Err.DESCRIPTION
Resume Exit_traghh_Click

قام بنشر

On Error GoTo Err_traghh_Click
 DoCmd.SetWarnings False
Me.Job_ID.SetFocus
If Me.flagsav = 1 And (IsNull(Me.Job_ID)) Then
If MsgBox("åá ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÓÌíá ÇáÈíÇäÇÊ ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
Exit Sub
Else
Me.flagsav = Null
Me.Refresh
Me.Requery
Me.OrderByOn = True
Me.OrderBy = "[Job_ID] DESC"
   End If
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÓÌíá  ÈäÌÇÍ.", 48, " "
End If
If (Not IsNull([Job_ID]) And Not IsNull(Me.flagsav) And (Me.flagsav = 1)) Then
If MsgBox("åá ÊÑíÏ ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÓÌíá ÇáÈíÇäÇÊ ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
 Exit Sub
Else
On Error Resume Next
With Me
.AllowDeletions = True
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRefresh
Me.Requery
Me.Refresh
DoCmd.SetWarnings True
.AllowDeletions = False
.AllowEdits = True
Me.OrderByOn = True
Me.OrderBy = "[Job_ID] DESC"
End With
   End If
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÓÌíá  ÈäÌÇÍ.", 48, " "
End If
If Me.flagsav = 2 Then
If MsgBox("åá ÊÑíÏ ÈÇáÝÚá ÇáÊÑÇÌÚ Úä ÊÚÏíá ÇáÈíÇäÇÊ   ¿", vbYesNo + vbCritical + vbMsgBoxRight + vbDefaultButton2, "ÊÍÐíÑ") = vbNo Then
   Exit Sub
   Else
   End If
Me.Refresh
With Me
.AllowEdits = True
End With
MsgBox "Êã ÇáÊÑÇÌÚ Úä ÇáÊÚÏíá ÈäÌÇÍ.", 48, " "
  DoCmd.RunSQL "UPDATE EMPLOYEES INNER JOIN EMPLOYEES_Temp ON EMPLOYEES.Job_ID = EMPLOYEES_Temp.Job_ID SET Cars_ machinery.Job_ID = [EMPLOYEES_Temp]![Job_ID], EMPLOYEES.ID_cant = [EMPLOYEES_Temp]![Vehicle Type],Cars_ machinery.Vehicle Type = [EMPLOYEES_Temp]![Vehicle Type];"
  DoCmd.RunSQL "UPDATE Tabl_2 INNER JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id SET Tabl_2.FName = [Tabl_2_Temp]![FName], Tabl_2.Kinship = [Tabl_2_Temp]![Kinship];"
  DoCmd.RunSQL "DELETE Tabl_2.*, Tabl_2.Nn_Id, Tabl_2_Temp.B_id " & _
" FROM Tabl_2 LEFT JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id " & _
" WHERE (((Tabl_2.Nn_Id)=[Forms]![frm_F]![N_id]) AND ((Tabl_2_Temp.B_id) Is Null));"
 DoCmd.RunSQL "INSERT INTO Tabl_2 " & _
" SELECT Tabl_2_Temp.* " & _
" FROM Tabl_2 RIGHT JOIN Tabl_2_Temp ON Tabl_2.B_id = Tabl_2_Temp.B_id " & _
" WHERE (((Tabl_2.B_id) Is Null) AND ((Tabl_2_Temp.Nn_Id)=[Forms]![frm_F]![N_id]));"
  End If
On Error Resume Next
AllowAdditions = False
AllowEdits = False
AllowDeletions = False
On Error GoTo 0
Me![cmdNext].Enabled = True
Me![cmdPrevious].Enabled = True
Me![cmdLast].Enabled = True
Me![cmdFirst].Enabled = True
Me![D_L].Enabled = True
Me![seva].Enabled = True
Me![cmdClose].Enabled = True
Me![addnew].Enabled = True
Me![Edit].Enabled = True
Me![traghh].Enabled = True
If DCount("*", "EMPLOYEES", "Job_ID") < 1 Then
Me![addnew].Enabled = True
Me![cmdNext].Enabled = True
Me![cmdPrevious].Enabled = False
Me![cmdLast].Enabled = False
Me![cmdFirst].Enabled = Fals
Me![D_L].Enabled = True
Me![cmdcols].Enabled = True
Me![Edit].Enabled = True
Me![sav].Enabled = True
Me![traghh].Enabled = True
AllowAdditions = True
AllowEdits = True
AllowDeletions = True
End If
Me.flagsav = Null
Me.traghh.Caption = ""
DoCmd.SetWarnings True
Exit_traghh_Click:
    Exit Sub
Err_traghh_Click:
MsgBox Err.DESCRIPTION
Resume Exit_traghh_Click

 

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