Transform DLookUp to Query

  • Thread starter EMILYTAN via AccessMonster.com
  • Start date
E

EMILYTAN via AccessMonster.com

Dim wI_Qty, wL_FinalQty, wM_Qty, wS_Qty, wW_KittedQty, wK_QtyIf NewRecord
Then 'nothingElse
wI_Qty = Nz(DSum("[I_Qty]", "Incoming", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)

wL_OwedQty = Nz(DSum("[L_OwedQty]", "LoanDetails", "[PartNumber]=""" & Forms!
Inventory!PartNumber & """"), 0)

wM_Qty = Nz(DSum("[M_Qty]", "Misc", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)
wS_Qty = Nz(DSum("[S_Qty]", "ShelfLife", "[PartNumber]=""" & Forms!
Inventory!PartNumber & """"), 0)

wW_KittedQty = Nz(DSum("[W_KittedQty]", "WIPRawDetails", "[PartNumber]="""
& Forms!Inventory!PartNumber & """"), 0)
wK_Qty = Nz(DSum("[K_Qty]", "Kanban", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)
Me.TotalQty = wI_Qty + wK_Qty + wL_OwedQty + wM_Qty + wS_Qty -
wW_KittedQtyEnd If
 
J

John W. Vinson

Dim wI_Qty, wL_FinalQty, wM_Qty, wS_Qty, wW_KittedQty, wK_QtyIf NewRecord
Then 'nothingElse
wI_Qty = Nz(DSum("[I_Qty]", "Incoming", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)

wL_OwedQty = Nz(DSum("[L_OwedQty]", "LoanDetails", "[PartNumber]=""" & Forms!
Inventory!PartNumber & """"), 0)

wM_Qty = Nz(DSum("[M_Qty]", "Misc", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)
wS_Qty = Nz(DSum("[S_Qty]", "ShelfLife", "[PartNumber]=""" & Forms!
Inventory!PartNumber & """"), 0)

wW_KittedQty = Nz(DSum("[W_KittedQty]", "WIPRawDetails", "[PartNumber]="""
& Forms!Inventory!PartNumber & """"), 0)
wK_Qty = Nz(DSum("[K_Qty]", "Kanban", "[PartNumber]=""" & Forms!Inventory!
PartNumber & """"), 0)
Me.TotalQty = wI_Qty + wK_Qty + wL_OwedQty + wM_Qty + wS_Qty -
wW_KittedQtyEnd If


Do you have a question, Emily?

John W. Vinson [MVP]
 
E

EMILYTAN via AccessMonster.com

Oops sorry, I forget to ask the question..
I want it to be written using query...
This is because I wan to load data directly into the table...
If I am using this, I can only see the calculated result when I open the form.
..
How if I want to generate report, it will based on the table data which is
not accurate...
Or, do you have any idea to make the calculated field is up-to-date which
having to open the form?
Dim wI_Qty, wL_FinalQty, wM_Qty, wS_Qty, wW_KittedQty, wK_QtyIf NewRecord
Then 'nothingElse
[quoted text clipped - 15 lines]
Me.TotalQty = wI_Qty + wK_Qty + wL_OwedQty + wM_Qty + wS_Qty -
wW_KittedQtyEnd If

Do you have a question, Emily?

John W. Vinson [MVP]
 
E

EMILYTAN via AccessMonster.com

Anyone there?
Oops sorry, I forget to ask the question..
I want it to be written using query...
This is because I wan to load data directly into the table...
If I am using this, I can only see the calculated result when I open the form.
..
How if I want to generate report, it will based on the table data which is
not accurate...
Or, do you have any idea to make the calculated field is up-to-date which
having to open the form?
[quoted text clipped - 5 lines]
John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Subform naming convention 6

Top