Utilisation de requête dans du VBA
Bonsoir, tout d'abord voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10
| dim rst, rsr2, rst3, rst4 as string
dim rec, rec2, rec3, rec4 as recordset
rst =" select MSN, désignation from Avion where Id_Avion = "& me.ancien_avion
rst2 =" select MSN, ésignation from Avion where Id_Avion = "& me.nouvel_avion
Set rec = CurrentDb.OpenRecordset(rst)
Set rec2 = CurrentDb.OpenRecordset(rst2)
rst3 = "select "& rec & ".MSN, "& rec & ".designation from "& rec
rst4 = "select "& rec2 & ".MSN, "& rec2 & ".designation from "& rec2
Set rec3 = Currentdb.openrecordset(rst3)
Set rec4 = currentdb.openrecordset(rst4) |
Ce qui ne marche pas sont mes "& rec & ", il y a une incompatibilité de type.
Quelqu'un a une idée ?