Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tabela buferizada
Message
From
07/02/2002 15:29:08
 
 
To
07/02/2002 11:56:45
Alexandre Sola
Witwise Adm de Bems S/C Ltda
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00616320
Message ID:
00616958
Views:
30
This message has been marked as the solution to the initial question of the thread.
Oi Alexandre;
>
>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  && lembre-se no VFP o alias tem o formato mealias.meucampo ao invés de ->
   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
   GO nRec
   DELETE
   TABLEREVERT(.T.)
   with thisform.cmdbotao
      .cmdproximo.Enabled  = .t.
      .cmdfinal.Enabled    = .t.
      .cmdinicio.Enabled   = .t.
      .cmdanterior.Enabled = .t.
      .cmdnovo.Enabled     = .t.
      .cmdvolta.Enabled    = .t.
      .cmdaltera.Enabled   = .t.
      .cmdapaga.Enabled    = .t.
      .cmdvisualiza.Enabled= .t.
      .cmdapaga.Enabled    = .t.
      .cmdimprime.Enabled  = .t.
   endwith
   ThisForm.Pag1.Pg2.cmdGrava.Enabled  = .f.
   ThisForm.Pag1.Pg2.cmdCancela.Enabled  = .f.
   return .f.
else
   with thisform.cmdbotao
      .cmdproximo.Enabled  = .f.
      .cmdfinal.Enabled    = .f.
      .cmdinicio.Enabled   = .f.
      .cmdanterior.Enabled = .f.
      .cmdnovo.Enabled     = .f.
      .cmdvolta.Enabled    = .f.
      .cmdaltera.Enabled   = .f.
      .cmdapaga.Enabled    = .f.
      .cmdvisualiza.Enabled= .f.
      .cmdapaga.Enabled    = .f.
      .cmdimprime.Enabled  = .f.
   endwith
   with thisform.pag1.pg2
      .cmdGrava.Enabled  = .t.
      .cmdCancela.Enabled  = .t.
   endwith
endif

procedure erromessage  && e disparada instantaneamente depois de um return .f. do seu campo
return "minha mensagem de erro é"
*
* qdo. entrar aqui o foco continuará no mesmo campo e a mensagem será enviada
*
endproc
Alexandre este exemplo que lhe mandei é policamente incorreto porque o certo seria na procedure refresh de cada campo você fazer algo como: ThisForm.Pag1.Pg2.cmdGrava.Enabled = thisform.lFoiencontrado

Toda vez que você quizer tornar este campo disponível basta setar thisform.lFoiencontrado para .t. e depois fazer thisform.refresh. Procure ver que em todo objeto existem procedimento que se comportam da forma do "estado" do seu form..


Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform