Am I right in thinking that you only want this button to appear in detail
view of a record?
If that's the case, define toolbartext inside the block for WBB{'detail'},
it will be evaluated in a context where all the $rec values are accessible.
This definition will over-ride any other value for the variable so you get
twice the value.
eg. $WBB{'detail'} =<<EOT
&PIC();
$WBB{'toolbarText'} = qq ("<FORM>
<INPUT TYPE="BUTTON" onClick="window.location=\'PrintLabel?id=$rec{ID}\';"
VALUE="Print Palette Label">
</FORM>);
# rest of definition follows
EOT
-- Malcolm Fitzgerald