Page 1 of 1

Aliasing Text Entry Variable

PostPosted: Tue Aug 21, 2007 10:19 am
by Wrangler
I have 12 buttons that open 1 container, which has 2 input boxes in it. Each button needs to connect to the correctly numbered table: ie. basement1, basement2, etc.

Problem is I can't figure a way to use the same container for all the tables. I tried this:

SetVar "[baseno]" "1" in button 1.

For the text enty variable:

[rvcompanion.basement[baseno].binnum]

This doesn't work. Didn't work in NeoDB either.

In the previous and next buttons etc. this works:

dbpnext "rvcompanion" "basement[baseno]"

So, I guess my question is how I would make this work without creating 12 containers, each using [rvcompanion.basement1.binnum], [rvcompanion.basement2.binnum] etc.

PostPosted: Tue Aug 21, 2007 11:45 am
by Neosoft Support
You can't use compound variables with text entry fields.

To do what you want you will need to use generic variables for your text entry fields. For example:

[Field1]
[Field2]

Then assign the data to those fields using the database's on change action. For example:

:DBOnChange
SetVar "[Field1]" "[rvcompanion.basement[baseno].binnum]"
SetVar "[Field2]" "[rvcompanion.basement[baseno].whatever]"
Return

Finally, to record edits made by the user you will either need to manually SetVar the generic variables back into the database variables or add code to the text entry field's TextChange actions. For example:

SetVar "[rvcompanion.basement[baseno].binnum]" "[Field1]"

PostPosted: Tue Aug 21, 2007 12:20 pm
by Wrangler
Thanks, Dave. I can make that work.