Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por felmback
Posts
#20707
Galera boa noite, estou com um problema nas textbox , tenho um bd em Access quando eu preencho as textbox e salvo aparece normal os dados no BD .

Mais ao inves de digitar eu colo os dados ela preenche normal clico para salvar ela executa o código porém quando vou no banco olhar não tem nada gravado , troquei as textbox.text por textbox.value mais não resolveu alguém poderia me apontar a onde estou errando .

ex:


Rs.Fields("Tecnico") = txtTecnico.Value
uso o seguinte código para efetuar a gravação no bd.

Private Sub btnGravar_Click()
On Error Resume Next



If Me.txtPon = "" Or Me.txtTecnico = "" Or Me.txtArd = "" Or Me.txtInstancia = "" Or Me.txtObs = "" Or Me.txtPri = "" Or Me.txtSec = "" Or Me.txtTecnico = "" Or Me.txtCop = "" Or Me.txtArea = "" Or Me.txtSupervisor = "" Then

MsgBox " Preencher todos os campos ", vbCritical, "OSP"


Exit Sub

End If

Rs.AddNew

Rs.Fields("Tecnico") = txtTecnico.Text
Rs.Fields("Instancia") = txtInstancia.Text
Rs.Fields("Supervisor") = txtSupervisor.Text
Rs.Fields("Armario") = txtArd.Text
Rs.Fields("Microarea") = txtArea.Text
Rs.Fields("CopOsp") = txtCop.Value
Rs.Fields("MotivoPendencia") = txtPendencia.Text
Rs.Fields("CodPon") = txtPonII.Text
Rs.Fields("Observacoes") = txtObs.Text
Rs.Fields("Primario") = txtPri.Text
Rs.Fields("Secundario") = txtSec.Text
Rs.Fields("EntradaOsp") = txtEntrada.Text


Rs.Update


MsgBox "Dados Salvos !", vbInformation, "OSP"



Me.txtTecnico.Text = ""
Me.txtInstancia.Text = ""
Me.txtSupervisor.Text = ""
Me.txtArd.Text = ""
Me.txtArea.Text = ""
Me.txtCop.Text = ""
Me.txtPendencia.Text = ""
Me.txtPonII.Text = ""
Me.txtObs.Text = ""
Me.txtPri.Text = ""
Me.txtSec.Text = ""

Me.txtTecnico.SetFocus
End Sub

https://1drv.ms/f/s!AiymJJaGKhi8grwwhCOph4wrFrgDgw
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord