Page 1 of 1

Variable to call a picture filed

PostPosted: Thu Feb 27, 2014 10:49 am
by Daved
I have an application that uses dynamic table names.
Everything seems to work with a variable inserted in the field and table calls.
I am trying to view and update a picture field.
[all_in_one.house_table.pic_1] works fine.
Var [cat_name] ="house_table"

[all_in_one.[cat_name].pic_1] fails on display or change of the picture field.

The record is the selected record in a grid.
Thanks in advance

Re: Variable to call a picture filed

PostPosted: Thu Feb 27, 2014 11:11 am
by Gaev

When you dbpOpenTable, specify a subroutine (e.g. myTableOpen).

Then, code this for the subroutine ...
Code: Select all
SetVar "[currentPicField]" "[all_in_one.[cat_name].pic_1]"
... and specify [currentPicField] as the variable associated with your Picture object

From the Help file ...
dbpOpenTable "database id" "table" "subroutine"

The name of a subroutine from your publication's Subroutine Action. The subroutine specified here will be automatically executed whenever the table is updated or the current record number changes. This can be useful if you want to activity to take place whenever the reader displays a different record. Subroutines are entered from the Actions page of NeoBook's Book Properties screen. NeoBook's help file contains more information on using subroutines.
... so your subroutine will be invoked every time there is a change in the "current record" ... the SetVar will update your variable with the most current values.