[Lazarus] Partially disabling DBNav based on a record set value

Chris Jennings cjvanbc at gmail.com
Sun Dec 6 20:02:47 CET 2009


Hi

Sorry I'm new to Lazarus and my Delphi experience is way in the past. I 
have spent the last four years in school studying an unrelated topic.

If I code

procedure TfrmSubjects.zqrySubjectsAfterScroll(DataSet: TDataSet);
begin
  DBNavigator1.VisibleButtons := [nbFirst,nbPrior,nbNext,nbLast,nbInsert];
end;

The above button list is displayed as soon as the program loads. I do 
however get the button list I am after.

I somehow need to be able to wrap this into an IF statement something like

If filed x = y then

procedure TfrmSubjects.zqrySubjectsAfterScroll(DataSet: TDataSet);
begin
  DBNavigator1.VisibleButtons := [nbFirst,nbPrior,nbNext,nbLast,nbInsert];
end;

endif

I am not able to figure out the if statment. I did know how to work with 
the DBNav buttons display.

JoshyFun wrote:
> Hello Lazarus-List,
>
> Sunday, December 6, 2009, 7:29:27 PM, you wrote:
>
> CJ> I have the following column as part of a mySQL table.
> CJ> `courses_subject_lock` CHAR(1) NOT NULL DEFAULT 'F'
> CJ> I would like to modify the state of a DBNav component such that some
> CJ> aspects of it are disabled based on a record set value.
> CJ> Specifically, I would like to disable only the DELETE function if the
> CJ> value for this field in a given recotd is set to T
>
> In the AfterScroll event of your query enable/disable the navigation
> buttons manually.
>
>   





More information about the Lazarus mailing list