Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having problem with an update-query

Status
Not open for further replies.

marlun

Programmer
Feb 7, 2003
70
SE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top