Re: Why is this throwing a primary key violation!!?!?



Well all I figured it out..it had to do with my query.. man I'm an idiot sometimes. I had an inner join in a query I was trying to update ... doh



]Josh Fraser wrote:
Thanks, I will try that. As for the method name, I thought it was appropriate :P

Guillem wrote:

Hi,

Josh Fraser wrote:


dmShippingAssumptions.SaveAss(qryJobInfo.FieldByName('CustomerID').AsI
nteger);



great method name <vbg>

  qryJobInfo.FieldByName('CustomerID').Value :=
dmCustomer.qryGetCustomer.FieldByName('CustomerID').value;



I suspect the problem could lie here. To check it, supposing your
CustomerID is an integer, try following:

qryJobInfo.FieldByName('CustomerID').asInteger :=
 dmCustomer.qryGetCustomer.FieldByName('CustomerID').asInteger;

if it's another type then use the corresponding AsXxxx method

.



Relevant Pages

  • Re: motorbike in Indiana Jones and the Kingdom of the Crystal Skull
    ... Ya feed an idiot. ... ..and I deny being "really old query" as that would matter anyway. ... Yeah Snarl, you homophobe. ...
    (rec.motorcycles.harley)
  • Re: Multi Selection List Box
    ... I'm an idiot. ... running the script. ... this box I need to run a query that filters on the items chosen. ...
    (microsoft.public.access.queries)
  • Re: motorbike in Indiana Jones and the Kingdom of the Crystal Skull
    ... See what happens when ya take out th' spoon? ... Ya feed an idiot. ... ...and I deny being "really old query" as that would matter anyway. ...
    (rec.motorcycles.harley)
  • Re: help with email address
    ... Be ye using some kind of pseudo-toolto build redoubtable website? ... Your query as written is ambiguous. ... He who laughs last sounds like an idiot. ...
    (alt.html)
  • Re: correlated subquery in the crosstab
    ... FROM (tblStudent INNER JOIN (tblClass INNER JOIN ... values from the outer query and I have made an alias for it. ... I have students, courses, exam groups containing exams of courses, ... that the crosstab query in access has much more capablities than ...
    (microsoft.public.access.queries)