I think my approach to this is probably way off base which is part of the reason I'm posting this question. I have a sub procedure that is actually using both ADO and DAO to perform what I would guess should be a fairly simple operation -- whatever record has the focus on the form, find the corresponding ID for that record in a table (where the record's ID is a FK but occurs only once in the table) and remove the ID.
The reason I'm using both ADO and DAO is that I need to refer both to the recordset of the table (for this I'm using ADO) and to the recordset on the form. I haven't figured a way to refer to the form's recordset and the record with the current focus using ADO whereas it is simple in DAO. So I'm mixing the two of them for now although I'd prefer to go 100% ADO if I can.
That's one problem. The other problem is that although this all works so far as finding the ID in the table that matches the ID in the form, I can't get it to change the value in the table. I get a data type mismatch error if I use something like: rst2("TenantID").Value = "" I'm not trying to delete the record, just remove the ID.
Can anyone help me out with what I'm doing wrong here. Any advice is appreciated.
The reason I'm using both ADO and DAO is that I need to refer both to the recordset of the table (for this I'm using ADO) and to the recordset on the form. I haven't figured a way to refer to the form's recordset and the record with the current focus using ADO whereas it is simple in DAO. So I'm mixing the two of them for now although I'd prefer to go 100% ADO if I can.
That's one problem. The other problem is that although this all works so far as finding the ID in the table that matches the ID in the form, I can't get it to change the value in the table. I get a data type mismatch error if I use something like: rst2("TenantID").Value = "" I'm not trying to delete the record, just remove the ID.
Can anyone help me out with what I'm doing wrong here. Any advice is appreciated.