Batch ADD Records

E

Ernst Guckel

Hey,

I have an Inventory Database that ADDs ALL active Items to 'tblInventory'
when a new day's Inventory is started. The problem is that once a new
Inventory is started for that day and you add new items to the Items table
there are 'NEW' active items that need to be on today's inventory. How do I
add the missing active items to todays Inventory? Here is what happens now:

Any ideas? Thanks,
Ernst.

sFilter = "[InvDate] = " & Format(txtInvDate(), STRING_DATE)
sFormName = FORM_BYDATE
iStoreNumber = GetSetting("StoreNumber")
sDate = Format(txtInvDate, STRING_DATE)

If IsNull(DLookup("[DateID]", TABLE_INV, "[InvDate] = " & sDate)) Then
sSQL = "Insert into tblInventory (InvID, StoreID, InvDate, InvItemCost)
Select " _
& "tblInventoryItems.InvID, " & iStoreNumber & ", " & sDate & "
,tblInventoryItems.InventoryCost" _
& " FROM tblInventoryItems WHERE tblInventoryItems.ActiveID=1;"

DoCmd.SetWarnings (False)
DoCmd.RunSQL sSQL
DoCmd.SetWarnings (True)

End If

Me.Filter = sFilter
Me.FilterOn = True
 
Top