Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2008

Tip: Looking for answers? Try searching our database.

problem with excel-like subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
forcefield - 26 Mar 2008 14:54 GMT
I have the following:
Form1:    
ItemID (autonumber)
Item (combo)

subForm1:
QtyID     (autonumber)
LinkedID (number)
EntryDate (Date)
InQty        (number)
OutQty      (number)
Balance (unbound)

Child Field is LinkedID and Master Field is ItemID

What I would like to do is when I enter data in the InQty and OutQty in the
subform (similar to Excel) the balance field(unbound) in the subform
automatically calculates the balance (with or without VBA)?  Is that possible
with form instead of report? I tried using control source of the Balance
field but the result is left much to be desired. Any idea, please?

Pdate             InQty   OutQty  Balance
02/01/2008      30         4            26
04/01/2008      10         0            36
10/01/2008      20         6            50
12/01/2008        0         2            48

Thanks
Alex Dybenko - 26 Mar 2008 16:20 GMT
Hi,

add Balance field to subform underlying query as Balance: [InQty]-[OutQty]

and bind balance field to it

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

>I have the following:
> Form1:
[quoted text clipped - 26 lines]
>
> Thanks
Paolo - 26 Mar 2008 16:26 GMT
Hi forcefield,

In the afterupdate event of InQty and OutQty put
Balance= nz(InQty,0)-nz(OutQty,0)
Be careful, if Balance is left unbound next time you go to an ID the
balance'll be vanished so is better if you add a field to your table to save
the calculated value.

HTH Paolo

> I have the following:
> Form1:    
[quoted text clipped - 24 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.