David-
Does your incoming file have any info about product line? If so, you can tweak your query to just consider that product line. Or, if you know the incoming data is for a particular product line, you can filter that out and do the inserts for just the relevant product line.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Feb 3, 2017, at 10:25 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
OK, this is embarrassing but I think I figured out what the problem is. And had I provided complete info in the beginning, you would have likely told me what the problem is.
My tblProductFamilies actually has another field. I left it out of the discussion thinking I would "keep the discussion simple". The additional field is ProductLineID (the product family can be in one of eight or so product lines). I have that field "required" property set to NO, and that is all I had considered when getting the key violation message, so I wrongly assumed it could not have anything to do with the inability to append records.
However, I have a many to one relationship set for that field and the lu_tblProductLines, ProductLineID field, with referential integrity enforced.
So this leaves me in a dilemma for which I need some advice. I have this large Excel spreadsheet, and there will be others to come later which are similar, and in this large flat file amongst other data, is a list of tanks and products in those tanks. I need to get "new" products (any that are not currently in my lu_tblProductFamilies) from that file. Any new products are obviously not yet related to a ProductLine record.
What is the best way to handle this?
1. delete the relationship between ProductFamily and ProductLine?
2. In the Append query just assign all the new products to an "Other" product line and manually correct them later?
3. some other choice?
Choice 2 seems like the best option to me.
__._,_.___
Posted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (18) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar