CAMPO_DATAHORA

MARCELO.TREZE 06/06/2011 17:29:06
#375999
veja a alteração

Public Function AlterarCtasPagar(ByVal strRegistro As String, _
strData As String, _
strForn As String, strFatura As String, _
strParcla1 As String, strDataParcla1 As String, _
strSit1 As String, strParcla2 As String, _
strDataParcla2 As String, strSit2 As String, _
strParcla3 As String, strDataParcla3 As String, _
strSit3 As String, strParcla4 As String, _
strDataParcla4 As String, strSit4 As String, _
strParcla5 As String, strDataParcla5 As String, _
strSit5 As String) As Variant

Dim sSQL As String

sSQL = sSQL & [Ô]Update TbCtasPagar Set[Ô]
sSQL = sSQL & [Ô] Data= [ô][Ô] & strData & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Forn= [ô][Ô] & strForn & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Fatura= [ô][Ô] & strFatura & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla1= [ô][Ô] & strParcla1 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DtaParcla1= [Ô] & IIf(strDataParcla1 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla1, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit1= [ô][Ô] & strSit1 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla2= [ô][Ô] & strParcla2 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DtaParcla2= [Ô] & IIf(strDataParcla2 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla2, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit2= [ô][Ô] & strSit2 & [Ô][ô],[Ô] [ô]Aqui esta = a false nao sei porque, estou procurando o porque.
sSQL = sSQL & [Ô] Parcla3= [ô][Ô] & strParcla3 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla3= [Ô] & IIf(strDataParcla3 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla3, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit3= [ô][Ô] & strSit3 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla4= [ô][Ô] & strParcla4 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla4= [Ô] & IIf(strDataParcla4 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla4, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit4= [ô][Ô] & strSit4 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla5= [ô][Ô] & strParcla5 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla5= [Ô] & IIf(strDataParcla5 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla5, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit5= [ô][Ô] & strSit5 & [Ô][ô][Ô]
sSQL = sSQL & [Ô] Where Registro = [Ô] & strRegistro

cn.Execute (sSQL)

AlterarCtasPagar = True

End Function


olha onde vc está errando

sSQL = sSQL & [Ô] DtaParcla1= [ô][Ô] & IIf(strDataParcla1 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla1, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô][ô],[Ô]


viu as aspas simples elas não podem existir

FERRAZ 10/06/2011 09:15:29
#376381
Meu amigo, valeu mais uma vez.

aspas...as aspas...caraca,

Com aspas simples
Errado: sSQL = sSQL & [Ô] DataParcla5= [ô][Ô] & IIf(strDataParcla5 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla5, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô] [ô] ,[Ô]

Sem aspas simples
Certo: sSQL = sSQL & [Ô] DataParcla5= [Ô] & IIf(strDataParcla5 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla5, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]

Valeu pela sua direcao meu amigo, viu me desculpem mais uma vez por minha demora em responder, estou tentando resolver o problema de conexao aqui na minha regiao.
FERRAZ 10/06/2011 09:21:59
#376382
Fiz as alteracoes e ficou muito bom.

Public Function AlterarCtasPagar(ByVal strRegistro As String, _
strData As String, _
strForn As String, strFatura As String, _
strParcla1 As String, strDataParcla1 As String, _
strSit1 As String, strParcla2 As String, _
strDataParcla2 As String, strSit2 As String, _
strParcla3 As String, strDataParcla3 As String, _
strSit3 As String, strParcla4 As String, _
strDataParcla4 As String, strSit4 As String, _
strParcla5 As String, strDataParcla5 As String, _
strSit5 As String) As Variant

Dim sSQL As String

sSQL = sSQL & [Ô]Update TbCtasPagar Set[Ô]
sSQL = sSQL & [Ô] Data= [ô][Ô] & strData & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Forn= [ô][Ô] & strForn & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Fatura= [ô][Ô] & strFatura & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla1= [ô][Ô] & strParcla1 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla1= [Ô] & IIf(strDataParcla1 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla1, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit1= [ô][Ô] & strSit1 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla2= [ô][Ô] & strParcla2 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla2= [Ô] & IIf(strDataParcla2 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla2, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit2= [ô][Ô] & strSit2 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla3= [ô][Ô] & strParcla3 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla3= [Ô] & IIf(strDataParcla3 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla3, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit3= [ô][Ô] & strSit3 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla4= [ô][Ô] & strParcla4 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla4= [Ô] & IIf(strDataParcla4 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla4, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit4= [ô][Ô] & strSit4 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] Parcla5= [ô][Ô] & strParcla5 & [Ô][ô],[Ô]
sSQL = sSQL & [Ô] DataParcla5= [Ô] & IIf(strDataParcla5 = [Ô][Ô], [Ô]null[Ô], [Ô]#[Ô] & Format(strDataParcla5, [Ô]mm/dd/yyyy[Ô]) & [Ô]#[Ô]) & [Ô],[Ô]
sSQL = sSQL & [Ô] Sit5= [ô][Ô] & strSit5 & [Ô][ô][Ô]
sSQL = sSQL & [Ô] Where Registro = [Ô] & strRegistro

cn.Execute (sSQL)

AlterarCtasPagar = True

End Function

Nesta linha aqui, eu troquei as propriedades da label que representa [Ô]strSit2[Ô], agora esta funcionando, agora sei o porque, muito bom isso.
sSQL = sSQL & [Ô] Sit2= [ô][Ô] & strSit2 & [Ô][ô],[Ô] 
[ô]Aqui esta = a false nao sei porque, estou procurando o porque.


Valeu.
Página 2 de 2 [13 registro(s)]
Tópico encerrado , respostas não são mais permitidas