How would I convert this excel formula into a MS Access or VBA? -


trying convert ms excel formula

=if((d2+c3)>0,0,(d2+c3)) 

how convert ms access or vba?

this dataset table in excel importing access

enter image description here

try this:

=iif(([rollover]+[bucket])>0,0,([rollover]+[bucket]))

although, excel formula references d2 , c3, in different rows. that's going bit tricky in access if that's need do. possible do, if that's want, may need add row number field (or autonumber id field) in order that.

blair

editted: (since read "see more comments")

the quick , dirty way add rownumber field, make query dataset calculated field output nextrownumber: [rownumber]+1. link query , dataset rownumber , nextrownumber. use [rollover] field query ([query]![rollover] , [bucket] field dataset ([dataset]![bucket]) in equation above.

there more elegant way in vba, linked query / dataset should work.

blair


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -