Hello. This question relates to using Excel as a front end user interface to update or add data records stored in an Access database. Let's say that I have a database in Access that lists different types of fruit and numerous characteristics for each fruit. I want the user to be able to type new or replacement fruit info in Excel and then have it add or update a record in Access.
Access would look like this:
access.jpeg
Excel would look like this:
excel.jpeg
What I want the VBA code to do is to check if there is an ID number in the Access table that matches the ID number in Excel A2. If there is a matching ID# then I want to overwrite all remaining fields of the matching Access record with the data from Row 2 in Excel. If there is no matching ID number, then I'd like the Row 2 data added as a new record.
In doing this, I don't want to have to refer to each column field individually, as I may add additional fields to the Access and Excel tables and don't want to have to update my VBA code to keep up. So I might refer to the Row 2 data in Excel perhaps as a named range or some other means. Whatever solution is suggested needs to work across different versions of Excel (2007-2016) and should be able to look through several thousand records very quickly to check for a possible match. Thanks in advance for the help!
Bookmarks