Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement