Hi Guys,
I've go a code that edits data in my [Taxi_Service] table:
Function Crew3_To_Crew2() As Variant
Dim db As Database
Dim Table As Recordset
Set db = DBEngine(0)(0)
Set Table = db.OpenRecordset("Taxi_Service")
Table.Edit
Table("Rank_3") = Forms!Taxi_Service!Rank_2
Table("Name_3") = Forms!Taxi_Service!Name_2
Table("Sirname31") = Forms!Taxi_Service!Sirname21
Table("Sirname32") = Forms!Taxi_Service!Sirname22
Table("Nationality_3") = Forms!Taxi_Service!Nationality_2
Table("Crew_Visa3") = Forms!Taxi_Service!Crew_Visa2
Forms!Taxi_Service!Rank_2 = Null
Forms!Taxi_Service!Name_2 = Null
Forms!Taxi_Service!Sirname21 = Null
Forms!Taxi_Service!Sirname22 = Null
Forms!Taxi_Service!Nationality_2 = Null
Forms!Taxi_Service!Crew_Visa2 = False
db.Close
End Function
But I'd like to edit data from a query Called [Update_Taxi_Service] using the same method. Since Set Table = db.OpenRecordset("Update_Taxi_Service") is not doing anything, I'd like to know where I'm going wrong.
Thanks for any answers.
Peps
I've go a code that edits data in my [Taxi_Service] table:
Function Crew3_To_Crew2() As Variant
Dim db As Database
Dim Table As Recordset
Set db = DBEngine(0)(0)
Set Table = db.OpenRecordset("Taxi_Service")
Table.Edit
Table("Rank_3") = Forms!Taxi_Service!Rank_2
Table("Name_3") = Forms!Taxi_Service!Name_2
Table("Sirname31") = Forms!Taxi_Service!Sirname21
Table("Sirname32") = Forms!Taxi_Service!Sirname22
Table("Nationality_3") = Forms!Taxi_Service!Nationality_2
Table("Crew_Visa3") = Forms!Taxi_Service!Crew_Visa2
Forms!Taxi_Service!Rank_2 = Null
Forms!Taxi_Service!Name_2 = Null
Forms!Taxi_Service!Sirname21 = Null
Forms!Taxi_Service!Sirname22 = Null
Forms!Taxi_Service!Nationality_2 = Null
Forms!Taxi_Service!Crew_Visa2 = False
db.Close
End Function
But I'd like to edit data from a query Called [Update_Taxi_Service] using the same method. Since Set Table = db.OpenRecordset("Update_Taxi_Service") is not doing anything, I'd like to know where I'm going wrong.
Thanks for any answers.
Peps