A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How sum a value directly from the table where equal to a subform c



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2009, 03:22 AM posted to microsoft.public.access
ldiaz
external usenet poster
 
Posts: 201
Default How sum a value directly from the table where equal to a subform c

Hello all.'

I would like to have this in an before event.

Dim StrProducedQty as string

I don't know how get this sum...
StrProducedQty = sum [Produced_Qty] from table [tbl_WOProduced] where
[tbl_WOProduced] is equal to this control on the subform (Work_OrderN)

Note: These are my forms and subform names.
FormName: frm_Production_Report
SubformName: sfrm_WOProduced

If StrProducedQty + me.Produced_Qty WOQty Then
MsgBox "Qty exceed the valance of the WO, type a lower value than the
valance", vbCritical, "Qty exceeded"
Cancel = True
End If



--
Lorenzo DÃ*az
Cad Technician
  #2  
Old May 7th, 2009, 03:45 AM posted to microsoft.public.access
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default How sum a value directly from the table where equal to a subform c

On Wed, 6 May 2009 19:22:07 -0700, ldiaz
wrote:

You can get the sum using the DSum function - see help file.

-Tom.
Microsoft Access MVP


Hello all.'

I would like to have this in an before event.

Dim StrProducedQty as string

I don't know how get this sum...
StrProducedQty = sum [Produced_Qty] from table [tbl_WOProduced] where
[tbl_WOProduced] is equal to this control on the subform (Work_OrderN)

Note: These are my forms and subform names.
FormName: frm_Production_Report
SubformName: sfrm_WOProduced

If StrProducedQty + me.Produced_Qty WOQty Then
MsgBox "Qty exceed the valance of the WO, type a lower value than the
valance", vbCritical, "Qty exceeded"
Cancel = True
End If

  #3  
Old May 7th, 2009, 03:14 PM posted to microsoft.public.access
ldiaz
external usenet poster
 
Posts: 201
Default How sum a value directly from the table where equal to a subfo

that does not work if I want to eliminate extra fields on the subform..

I want a string

--
Lorenzo DÃ*az
Cad Technician


"Tom van Stiphout" wrote:

On Wed, 6 May 2009 19:22:07 -0700, ldiaz
wrote:

You can get the sum using the DSum function - see help file.

-Tom.
Microsoft Access MVP


Hello all.'

I would like to have this in an before event.

Dim StrProducedQty as string

I don't know how get this sum...
StrProducedQty = sum [Produced_Qty] from table [tbl_WOProduced] where
[tbl_WOProduced] is equal to this control on the subform (Work_OrderN)

Note: These are my forms and subform names.
FormName: frm_Production_Report
SubformName: sfrm_WOProduced

If StrProducedQty + me.Produced_Qty WOQty Then
MsgBox "Qty exceed the valance of the WO, type a lower value than the
valance", vbCritical, "Qty exceeded"
Cancel = True
End If


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.