Click here to Skip to main content
15,915,820 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB.NET Pin
Babayomi28-Apr-20 12:07
Babayomi28-Apr-20 12:07 
GeneralRe: VB.NET Pin
Ralf Meier28-Apr-20 20:01
mveRalf Meier28-Apr-20 20:01 
AnswerRe: VB.NET Pin
Richard MacCutchan28-Apr-20 21:44
mveRichard MacCutchan28-Apr-20 21:44 
QuestionCompare File Date Created Date Modified in VBA ( Allow Download time 20 mintes Buffer Time) Pin
Member 1478441625-Apr-20 3:27
Member 1478441625-Apr-20 3:27 
AnswerRe: Compare File Date Created Date Modified in VBA ( Allow Download time 20 mintes Buffer Time) Pin
Richard MacCutchan25-Apr-20 4:14
mveRichard MacCutchan25-Apr-20 4:14 
QuestionBinding Navigator Movement Event Error Pin
Member 1480975421-Apr-20 23:23
Member 1480975421-Apr-20 23:23 
AnswerRe: Binding Navigator Movement Event Error Pin
Gerry Schmitz22-Apr-20 9:14
mveGerry Schmitz22-Apr-20 9:14 
GeneralRe: Binding Navigator Movement Event Error Pin
Member 1480975422-Apr-20 23:16
Member 1480975422-Apr-20 23:16 
GeneralRe: Binding Navigator Movement Event Error Pin
Mycroft Holmes23-Apr-20 11:16
professionalMycroft Holmes23-Apr-20 11:16 
QuestionLogoff or disconnect system account session at Ctrl + Alt + Delete screen Pin
Member 146239898-Apr-20 17:20
Member 146239898-Apr-20 17:20 
AnswerRe: Logoff or disconnect system account session at Ctrl + Alt + Delete screen Pin
Member 1462398914-Apr-20 9:23
Member 1462398914-Apr-20 9:23 
QuestionVisual Basic "originated from an internet" EXCEL Pin
raeyoung7-Apr-20 4:18
raeyoung7-Apr-20 4:18 
QuestionRe: Visual Basic "originated from an internet" EXCEL Pin
Richard MacCutchan7-Apr-20 4:50
mveRichard MacCutchan7-Apr-20 4:50 
AnswerRe: Visual Basic "originated from an internet" EXCEL Pin
raeyoung7-Apr-20 7:22
raeyoung7-Apr-20 7:22 
GeneralRe: Visual Basic "originated from an internet" EXCEL Pin
Richard MacCutchan7-Apr-20 7:59
mveRichard MacCutchan7-Apr-20 7:59 
GeneralRe: Visual Basic "originated from an internet" EXCEL Pin
raeyoung7-Apr-20 8:07
raeyoung7-Apr-20 8:07 
GeneralRe: Visual Basic "originated from an internet" EXCEL Pin
Richard MacCutchan7-Apr-20 9:12
mveRichard MacCutchan7-Apr-20 9:12 
AnswerRe: Visual Basic "originated from an internet" EXCEL Pin
Mycroft Holmes7-Apr-20 11:15
professionalMycroft Holmes7-Apr-20 11:15 
QuestionInstall a VB Net application to install a sql database on other computers Pin
Member 147798703-Apr-20 12:41
Member 147798703-Apr-20 12:41 
AnswerRe: Install a VB Net application to install a sql database on other computers Pin
Dave Kreskowiak3-Apr-20 14:12
mveDave Kreskowiak3-Apr-20 14:12 
AnswerRe: Install a VB Net application to install a sql database on other computers Pin
evry1falls6-May-20 9:22
evry1falls6-May-20 9:22 
QuestionLinq GroupBy Invoice Number, iterate all items before group Pin
jkirkerx3-Apr-20 7:48
professionaljkirkerx3-Apr-20 7:48 
AnswerRe: Linq GroupBy Invoice Number, iterate all items before group Pin
jkirkerx3-Apr-20 8:51
professionaljkirkerx3-Apr-20 8:51 
Perhaps the answer is to just perform the calc after the grouping.
Group the Invoices, then loop them, and do another linq to go back to the original and grab the items.
'Use Linq to Group the Invoices Together
                Dim gInvoicesAll As List(Of MarginCustomerInvoicesR1) = cTpAll.OrderBy(Function(ob) ob.FINVNO).GroupBy(Function(inv) inv.FINVNO).Select(Function(cl) New MarginCustomerInvoicesR1() With {
    .FCustNo = cl.First().FCUSTNO,
    .FInvNo = cl.First().FINVNO,
    .FShipDate = cl.First().FSHIPDATE,
    .FDescript = cl.First().FDESCRIPT,
    .FAmount = cl.Sum(Function(sum) sum.FAMOUNT),
    .FExtCost = 0,
    .FExtPrice = 0,
    .FExtMargin = 0,
    .FPercent = 0
}).ToList()

Dim rsDataRow As DataRow
For Each pI As MarginCustomerInvoicesR1 In gInvoicesAll

  'Instead of using Linq, I'll just iterate the original data before grouping
  Dim items = cTpAll.Where(Function(item) item.FINVNO.Equals(pI.FInvNo)).ToList()
  For Each item In items
    pI.FExtCost += If(item.FCOST <> 0 And item.FSHIPQTY <> 0, item.FCOST * item.FSHIPQTY, 0)
    pI.FExtPrice += If(item.FPRICE <> 0 And item.FSHIPQTY <> 0, item.FPRICE * item.FSHIPQTY, 0)
    pI.FExtMargin += pI.FExtPrice - pI.FExtCost
  Next
If it ain't broke don't fix it
Discover my world at jkirkerx.com

GeneralRe: Linq GroupBy Invoice Number, iterate all items before group Pin
Richard Deeming6-Apr-20 1:19
mveRichard Deeming6-Apr-20 1:19 
GeneralRe: Linq GroupBy Invoice Number, iterate all items before group Pin
jkirkerx6-Apr-20 7:28
professionaljkirkerx6-Apr-20 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.