Importing data - check if field in table is populated?

chuckles1066

Banned
Joined
Dec 20, 2004
Messages
372
I have to import data daily into a table.

The table has an extra field named "Import Date"........after each import, I run a query that asks me for a date, I input today's date and it updates any rows in that field that are null.

But if I forget to run the query and then perform a subsequent import............

So......is there a way somehow to interrupt the whole File / Get External Data / Import thing with a "there is data in the table that hasn't been updated" routine (which checks for a null value in the "Import Date" field).

XP is the Office version.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If you use File > Get External Data > Import then there is no way to interrupt that. But if you do the import using code then you can use
Code:
If DCount("*", "tableNameHere", "[Import Date] Is Null) > 0 Then
   MsgBox "There are records with no import date already in the table!", vbExclamation
Exit Sub
End If
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,887
Members
452,948
Latest member
Dupuhini

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