Etxezarreta
Member
- Local time
- Tomorrow, 00:01
- Joined
- Apr 13, 2020
- Messages
- 175
Hello everyone,
In a form, I populate the source table DSP_RDV_CRRDV_t_CompteRendusListesThematiques" with some data, and I will send selected items of the list boxes to anoteher one: "DSP_RDV_CRRDV_t_CompteRendusListesThematiques", using a loop. To populate a field of this last table, I need to obtain the primary key generated in my first table (in order to create a foreign key).
The problem is: I dont know how to pass from str_Sql = "SELECT MAX(ID_CompteRendu_RDV) AS max FROM DSP_RDV_CRRDV_t_CompteRendus" to the value of this string..
I have bee trying to use ADO method, but I am a bit confused: the recordset is a single value, how can I assign this value to my variable, intMaxOfID_CompteRendu_RDV, that will be the value of the FK_CompteRendu_RDV field of the DSP_RDV_CRRDV_t_CompteRendusListesThematiques table?
I guess this is easy: you will find my trial in "Private Sub bt_ValiderChoixPraticien_Click()"
Thanks.
Etxe.
In a form, I populate the source table DSP_RDV_CRRDV_t_CompteRendusListesThematiques" with some data, and I will send selected items of the list boxes to anoteher one: "DSP_RDV_CRRDV_t_CompteRendusListesThematiques", using a loop. To populate a field of this last table, I need to obtain the primary key generated in my first table (in order to create a foreign key).
The problem is: I dont know how to pass from str_Sql = "SELECT MAX(ID_CompteRendu_RDV) AS max FROM DSP_RDV_CRRDV_t_CompteRendus" to the value of this string..
I have bee trying to use ADO method, but I am a bit confused: the recordset is a single value, how can I assign this value to my variable, intMaxOfID_CompteRendu_RDV, that will be the value of the FK_CompteRendu_RDV field of the DSP_RDV_CRRDV_t_CompteRendusListesThematiques table?
I guess this is easy: you will find my trial in "Private Sub bt_ValiderChoixPraticien_Click()"
Thanks.
Etxe.