Hello,
I would like to update a record in a table using code.
From my research it seems I would need to use a DAO or ADO connection.
If so which is the best? - The table is currently in Access (2013), but in the future it may end up in a sql server backend.
Could someone help me firstly decide which method is the best (or is there a better method)?
Basically I have a table called tbl_cars (with unique reference car_id)
Within the table I have a field named SOLD.
When I click a button on a form I would like the SOLD field to be updated to YES.
I understand that I could bind the table to the form - but in this instance this would not be desirable.
Is it also possible for the code to check whether the record exists and whether the record is currently being edited (to ensure that the code executes correctly - or tells the user that it couldn't update the record as it is currently being edited / doesn't exist?)
Many thanks for any help you can provide with this.
Best regards
Mark
I would like to update a record in a table using code.
From my research it seems I would need to use a DAO or ADO connection.
If so which is the best? - The table is currently in Access (2013), but in the future it may end up in a sql server backend.
Could someone help me firstly decide which method is the best (or is there a better method)?
Basically I have a table called tbl_cars (with unique reference car_id)
Within the table I have a field named SOLD.
When I click a button on a form I would like the SOLD field to be updated to YES.
I understand that I could bind the table to the form - but in this instance this would not be desirable.
Is it also possible for the code to check whether the record exists and whether the record is currently being edited (to ensure that the code executes correctly - or tells the user that it couldn't update the record as it is currently being edited / doesn't exist?)
Many thanks for any help you can provide with this.
Best regards
Mark