Amigos, estou iniciando na programação e estou com um problema....tenho que somar os valores de uma coluna...é um grid acoplado no form.....éu peguei o fonte e estou fazendo as alterações que preciso....o código que tenho é este....
'Retorna fórmula direta campo VALOR ICMS NF VENDA, tabela NF_VENDA
Private Function Pit_0017F9() As Double ' {* Apelidos *} 700
Dim Sgvlricmsnfvenda As Double
If Empresas![Tipo icms empresa] <> "TRADICIONAL" Then
Sgvlricmsnfvenda = Round(((Nf_venda![Base icms nf venda] * Nf_venda![Icms perc nf venda] )/100), 2)
Else
If Clientes![Uf fatura cliente] = "SP" Then
Sgvlricmsnfvenda = Round(Itens_nf_venda![Vlr icms iten nf venda])
ElseIf Clientes![Uf fatura cliente] <> "SP" And Clientes![Tipo cliente] = "JURÍDICA" And(Clientes![Inscrição rg cliente] = "ISENTA" Or Clientes![Inscrição rg cliente] = "EM ANDAMENTO") Then
Sgvlricmsnfvenda = Round(((Nf_venda![Base icms nf venda] * Nf_venda![Icms perc nf venda] )/100), 2)
ElseIf Clientes![Uf fatura cliente] <> "SP" And Clientes![Tipo cliente] = "FÍSICA" Then
Sgvlricmsnfvenda = Round(((Nf_venda![Base icms nf venda] * Nf_venda![Icms perc nf venda] )/100), 2)
ElseIf Clientes![Uf fatura cliente] <> "SP" And Clientes![Tipo cliente] = "JURÍDICA" And Clientes![Inscrição rg cliente] > 1 Then
Sgvlricmsnfvenda = Round(((Nf_venda![Base icms nf venda] * Nf_venda![Icms perc nf venda] )/100), 2)
End If
End If
Pit_0017F9 = Sgvlricmsnfvenda 'Deve retornar um número
End Function
o problema está no código em vermelho......c puderem me ajudar...