Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Amigos, porque o INSERT INTO não aceita gravar o caracter hífem(-)?
se o TxtOF.text esta preenchido com o texto (45869), o codigo automaticamente altera para (OF-45869) gravando o campo corretamente.
Se o TxtOF.text esta com (" ") Vazio, o codigo altera o mesmo para (-), estando o TxtOF.text com o caracter (-) o INSERT INTO não grava o mesmo. Alguem sabe me explicar por que?
If ComboDisp.text = "00
3" Then
TxtOF.text = "-"
End If
If TxtOF.text = "" Then
TxtOF.text = "-"
ElseIf TxtOF.text = Right$(TxtOF.text, 5) Then
TxtOF.text = "OF" & "-" & Mid(TxtOF.text, 1, 5)
end if
Set OP = New ADODB.Command
If MsgBox("Confirma a inclusão desse item na LM?", vbYesNo + vbQuestion) = vbYes Then
With OP
.ActiveConnection = Banco1
'.CommandText = "INSERT INTO Movimento (Disp,Origem,Destino,[OF],Obra,Fabrica,Posicao,Quant,[Desc],[Req],CSobra,[ID],[L
M]) values ('" & ComboDisp.text & "','" & ComboOrigem.text & "','" & ComboDestino & "','" & TxtOF.text & "','" & TxtObra.text & "','" & TxtFab.text & "','" & TxtPos.text & "','" & TxtQT.text & "','" & ComApostrofo(TxtDesc.text) & "','" & TxtReq.text & "','" & TxtSobra.text & "','" & Lb_ID.Caption & "','" & NrLista & "')"
.CommandText = "INSERT INTO Movimento (Disp,Origem,Destino,[OF],Obra,Fabrica,Posicao,Quant,[Desc],[Req],CSobra,[ID],[L
M]) values ('" & ComboDisp.text & "','" & ComboOrigem.text & "','" & ComboDestino & "','" & TxtOF.text & "','" & TxtObra.text & "','" & TxtFab.text & "','" & TxtPos.text & "','" & TxtQT.text & "','" & ComApostrofo(TxtDesc.text) & "','" & TxtReq.text & "','" & TxtSobra.text & "','" & Lb_ID.Caption & "','" & NrLista & "')"
.Execute
End WithCarregando comentários...