Help constructing an update query

Montez659

Well-known Member
Joined
May 4, 2005
Messages
918
I know how to do an update query and I can probably figure out how to search for records that are LIKE a variable, but not sure how I can put these together. Let me explain.

I import from an excel sheet using VBA, and for a frame of reference it is an attendance sheet. There are two hidden columns that contain the contactID and the attendanceID. The contactID is from tblContacts - self explanatory. The attendanceID is a junction table that has one-to-many relationships with tblContacts and tblGroups.

The dilemma is that if someone were to add a name and some contact info to the excel spreadsheet, there would exist no contactID and attendanceID for that person. The sheet is still imported into a temporary table. This is where I am getting stuck.

I figure that I would run a query on the temp table to see if the contactID and attendanceID fields are null, and if they are, search tblContacts to see if that name exists. If the name (fname and lname) doesn't exist, I would need to run an append query. I know how to do the append, just not sure how to structure the query to search and append, or essentially linking these together so that they run in the correct order.

Clear as a foggy day in London town? I thought so.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Ok, I take that back. There is only one hidden column on the Excel spreadsheet containing the attendanceID. The stakes are still the same though. Would still need to search and append.
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,391
Members
452,909
Latest member
VickiS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top