Hi! I have an If-criteria below, when it's true I want it to run this update query where I have a field (Amount1) in a table "tblLager", I want that amount to be updated with an "Amount2" that comes from a form (Which i fill in).
If DCount("ProdSN", "tblLager", "ProdSN = '" & Me!ProdSN & "' And ProjIn = '" & Me!ProjIn & "'"
> 0 Then
stDocName2 = "qryLager_uppdatera"
DoCmd.OpenQuery stDocName2, acNormal, acEdit
Iwant it to add Amount1 with Amount2, but it gives me a weird answer. If the current Amount is 5, and I add want to add 1, then the answer can be 11. This is how my update-query looks like:
Field: Amount ProjIn ProdSN
Table: tblLager tblLager tblLager
^
Update to:[Amount1]+[Forms]![frmInLev]![Amount2]
Criteria: [Forms]![frmInLev]![ProjIn] And [Forms]![frmInLev]![ProdSN]
Seems like it depends on how many posts I have in the "tblLager"-table. When there are five posts and I want to add one it adds five, and if there are six posts it adds six.
Hope you understand my query.
thanks
/marlun
If DCount("ProdSN", "tblLager", "ProdSN = '" & Me!ProdSN & "' And ProjIn = '" & Me!ProjIn & "'"
stDocName2 = "qryLager_uppdatera"
DoCmd.OpenQuery stDocName2, acNormal, acEdit
Iwant it to add Amount1 with Amount2, but it gives me a weird answer. If the current Amount is 5, and I add want to add 1, then the answer can be 11. This is how my update-query looks like:
Field: Amount ProjIn ProdSN
Table: tblLager tblLager tblLager
^
Update to:[Amount1]+[Forms]![frmInLev]![Amount2]
Criteria: [Forms]![frmInLev]![ProjIn] And [Forms]![frmInLev]![ProdSN]
Seems like it depends on how many posts I have in the "tblLager"-table. When there are five posts and I want to add one it adds five, and if there are six posts it adds six.
Hope you understand my query.
thanks
/marlun