5
I see you already have a question similar with mine only that is in C#.
I’m doing a field check routine and when one of the date fields is empty it gives the message. I need that when one of these fields is in focus, show the name of the field in the message body.
Codice:
if (cbbTipoConsultaEmAberto.ItemIndex = 5) and
((dteDataInicial.Text = ' / / ') or
(dteDataFinal.Text = ' / / ')) then
begin
if (dteDataInicial.Text = ' / / ') then dteDataInicial.SetFocus else
if (dteDataFinal.Text = ' / / ') then dteDataFinal.SetFocus;
Application.MessageBox(PChar('Combinação de Seleção Inválida!'+#13+'Campo:
'+TDBDateEdit({aqui tenho que saber qual o objeto com o foco}).Hint+
' está em branco.'),'Aviso',MB_OK+MB_ICONEXCLAMATION);
exit;
end;
So from 'access Violation'
– Edu Mendonça
I managed to.... I removed the . Name and it worked... it was like this
...TDBDateEdit(Self.ActiveControl).Hint...
– Edu Mendonça
I applied the correction to the answer.
– Roberto de Campos