General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Ok Claudio
Fiz ok voce me pediu e deu certo (OBRIGADO) pois bem gostaria de saber aonde eu posso consistir se o codigo ja existe.. para dar a mensagem para o usuário..
tenho o seguinte codigo no metodo do lostfocus() do campo da chave primaria cgc
nRec=Recno()
set exact on
SEEK ThisForm.Pag1.Pg2.Text1.Value
If Found()
ThisForm.Pag1.Pg2.Text2.Value = Saifd ->znom
ThisForm.Pag1.Pg2.Text3.Value = Saifd ->zie
ThisForm.Pag1.Pg2.Text4.Value = Saifd ->zest
ThisForm.Pag1.Pg2.Text5.Value = Saifd ->zmun
ThisForm.Pag1.Pg2.Text6.Value = Saifd ->zemp
wait window timeout 3 "Chave ja Existente "
GO nRec
DELETE
TABLEREVERT(.T.)
ThisForm.cmdbotao.cmdproximo.Enabled = .t.
ThisForm.cmdbotao.cmdfinal.Enabled = .t.
ThisForm.cmdbotao.cmdinicio.Enabled = .t.
ThisForm.cmdbotao.cmdanterior.Enabled = .t.
ThisForm.cmdbotao.cmdnovo.Enabled = .t.
ThisForm.cmdbotao.cmdvolta.Enabled = .t.
ThisForm.cmdbotao.cmdaltera.Enabled = .t.
ThisForm.cmdbotao.cmdapaga.Enabled = .t.
ThisForm.cmdbotao.cmdvisualiza.Enabled= .t.
ThisForm.cmdbotao.cmdapaga.Enabled = .t.
ThisForm.cmdbotao.cmdimprime.Enabled = .t.
ThisForm.Pag1.Pg2.cmdGrava.Enabled = .f.
ThisForm.Pag1.Pg2.cmdCancela.Enabled = .f.
else
ThisForm.cmdbotao.cmdproximo.Enabled = .f.
ThisForm.cmdbotao.cmdfinal.Enabled = .f.
ThisForm.cmdbotao.cmdinicio.Enabled = .f.
ThisForm.cmdbotao.cmdanterior.Enabled = .f.
ThisForm.cmdbotao.cmdnovo.Enabled = .f.
ThisForm.cmdbotao.cmdvolta.Enabled = .f.
ThisForm.cmdbotao.cmdaltera.Enabled = .f.
ThisForm.cmdbotao.cmdapaga.Enabled = .f.
ThisForm.cmdbotao.cmdvisualiza.Enabled= .f.
ThisForm.cmdbotao.cmdapaga.Enabled = .f.
ThisForm.cmdbotao.cmdimprime.Enabled = .f.
ThisForm.Pag1.Pg2.cmdGrava.Enabled = .t.
ThisForm.Pag1.Pg2.cmdCancela.Enabled = .t.
endif
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only