1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| Dim rs As DAO.Recordset
Dim lng As Long
Dim oper As String
Dim inc As String
Dim eqpt As String
Dim safe As String
'On copie l'enregistrement "jobcard"
Set rs = CurrentDb.OpenRecordset("jobcard")
With rs
.AddNew
'On copie les champ voulu sauf celui de la clé primaire :
!jc_number = Me!jc_number
!libelle = Me!libelle
!rev = Me!rev
!work_sequence = Me!work_sequence
!disc_ID = Me!disc_ID
!syst_ID = Me!syst_ID
!platform_ID = Me!platform_ID
!location_ID = Me!location_ID
!punchlist = Me!punchlist
!adscope = Me!adscope
!pid = Me!pid
!preparator_ID = Me!preparator_ID
!date_creation = Me!date_creation
!num_sheet = Me!num_sheet
.Update
.Bookmark = .LastModified
lng = !jobcard_ID
End With
'On copie les enregistrements "Operations"
oper = "INSERT INTO operation ( jobcard_ID, pos_in_jc, description, hours, activity_ID, category_operation_ID ) SELECT " & lng & ", pos_in_jc, description, hours, activity_ID, category_operation_ID FROM operation "
'On copie les enregistrements "Materiels incorpores"
inc = "INSERT INTO material_inc ( jobcard_ID, description, qty, unit_ID, location, pr_and_item_ID ) SELECT " & lng & ", description, qty, unit_ID, location, pr_and_item_ID FROM material_inc "
'On copie les enregistrements "Materiels Equipements"
eqpt = "INSERT INTO material_eqpt ( jobcard_ID, description, qty, unit_ID, location ) SELECT " & lng & ", description, qty, unit_ID, location FROM material_eqpt "
'On copie les enregistrements "Safety"
safe = "INSERT INTO safety ( jobcard_ID, safety_recommand ) SELECT " & lng & ", safety_recommand FROM safety "
DoCmd.RunSQL safe
DoCmd.RunSQL oper
DoCmd.RunSQL inc
DoCmd.RunSQL eqpt
Forms!frm_jobcard.Requery
DoCmd.GoToRecord , , acLast
Me.rev.SetFocus |
Partager