I have a form with several subforms embedded. The user can select which subform is shown by selecting the name of the subform from a combobox.
I want to have a button to run some vba to update the table on which the visible subform is based, which has the same name as the subform, with the value of a textbox elsewhere on the form.
At the moment I have:
Code:
db.Execute "UPDATE table_to_update SET [" & table_to_update & "].[Project] = """ & Text89.Value & """ WHERE [" & table_to_update & "].[ID] = " & Forms!T_entity.T_Conflict.Form.ID
Where the string table_to_update is successfully set as the combobox value earlier in the code.
I am a bit lost both when it comes to referencing subforms and sql in vba and would really appreciate any help!