PDA

View Full Version : Help with variables


ABC123

Fred Daniel
03-06-2005, 06:20 PM
I've created a form with 2 variables (char) and made them global. Next I want to update all the records in a table with the new variable. When I try to creat an operation and say the table field =the variable I get does not equate to a cahr. ANy ideas

Cheryl Lemire
03-06-2005, 06:49 PM
Fred,

If you are placing the 'variable' objects on your form and looking for input from an end user ... you could use the OnDepart or OnChange event of the object. A better way might be to use the OnSave event of the form itself and code it to update your tables with the values in the variables.

Providing us with more specific details may allow us to assist further. Maybe even attaching a stripped down copy of the db with the form we need to look at and what fields/tables you want to update.

Good luck
Cheryl

Stan Mathews
03-07-2005, 04:44 AM
I just created such a scenario so we know it is possible. The slip-up that catches some is that in an operation such as this, the definition you enter is a field and an expression. If you are entering field name and then your expression is field name = variable, you will have a problem because your expression now evaluates to a logical value.

Are you using the operations genie or are you trying to code it in xbasic? In the genie you can see how the exprssion evaluates, and its type, by using the expression editor. Screenshot attached (note the result and type at the bottom).