*** THIS IS AREPOST AS I CAN’T FIND THE ORIGINAL POST ***<o
></o
>
<o
> </o
>
Hi. I’m anewbie to Access but seasoned in Excel and VBA. <o
></o
>
<o
> </o
>
Starting in row2 of an Excel worksheet I have 1 to 50 rows containing 7 columns of data thatif not found in an Access table of over 50,000 records must be transferred tothe Access table.<o
></o
>
<o
> </o
>
The columnarlayout of the Excel file and the Access table are identical.
Within Access fields 2, 3 and 7 are designated as “Primary” fields ifthat’s an issue.<o
></o
>
<o
> </o
>
I know how tofind a record based on one field within Access. But once a recordmatches criteria 1, how to compare the additional two fields of that record andcontinuing the testing to the EOF if not found has me stumped.<o
></o
>
<o
> </o
>
In summary, thequestion is how to loop through an Access table to find if a record existsmatching three fields of a seven field record (in Excel) then adding the newrecord into Access if the Excel row’sdata wasn’t found in the Access table. If a three-way match recordwas found, I'd like to overwrite the existing record entirely andthen advance to the next Excel row then repeat the matching for that row's"record" from the beginning of the Access table.
I'm using Access 2007 and Excel 2007.<o
></o
>
<o
> </o
>
Any insightwould be most appreciated. Thanks inadvance for your help. <o
></o
>
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
Hi. I’m anewbie to Access but seasoned in Excel and VBA. <o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
Starting in row2 of an Excel worksheet I have 1 to 50 rows containing 7 columns of data thatif not found in an Access table of over 50,000 records must be transferred tothe Access table.<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
The columnarlayout of the Excel file and the Access table are identical.
Within Access fields 2, 3 and 7 are designated as “Primary” fields ifthat’s an issue.<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
I know how tofind a record based on one field within Access. But once a recordmatches criteria 1, how to compare the additional two fields of that record andcontinuing the testing to the EOF if not found has me stumped.<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
In summary, thequestion is how to loop through an Access table to find if a record existsmatching three fields of a seven field record (in Excel) then adding the newrecord into Access if the Excel row’sdata wasn’t found in the Access table. If a three-way match recordwas found, I'd like to overwrite the existing record entirely andthen advance to the next Excel row then repeat the matching for that row's"record" from the beginning of the Access table.
I'm using Access 2007 and Excel 2007.<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
<o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
Any insightwould be most appreciated. Thanks inadvance for your help. <o
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
![Stick out tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)