Subject | Re: Field Intercepts? |
---|---|
Author | gsndelphicoder |
Post date | 2007-12-18T19:44:36Z |
--- In IBObjects@yahoogroups.com, "Roger Vellacott" <rvellacott@...>
wrote:
That worked except that I had to change the UserGetText declaration to:
procedure SomeDataModule.UserGetText(Field: TField; var Text: String;
DisplayText: Boolean);
begin
Text := UserNames[Field.AsInteger];
DisplayText := True;
end;
wrote:
>Thank You Roger!
> Something like this.
>
>
>
> In your system initialisation, create an array of user names and their
> numbers.
>
>
>
> Procedure MyQueryAfterOpen(Dataset:TDataset);
>
> Begin
>
> Dataset.FieldByname('USER_NR').OnGetText :=
> SomeDataModule.UserGetText;
>
> End;
>
>
>
> Procedure SomeDataModule.UserGetText(Field:TField);
>
> Begin
>
> With Field do
>
> . DisplayText := UserNames[AsInteger];
>
> End;
>
>
>
> Roger Vellacott
>
> Passfield Data Systems Ltd
>
>
>
That worked except that I had to change the UserGetText declaration to:
procedure SomeDataModule.UserGetText(Field: TField; var Text: String;
DisplayText: Boolean);
begin
Text := UserNames[Field.AsInteger];
DisplayText := True;
end;