Tip of the Month (May 2005)
A Jump Button can be used to jump from one record to another based on a value that is common to both records. If the "never create" property is selected and there is no corresponding records in the destination table, Visual CE puts up a "Record not found" error message. Instead of the "Record not found" error, you might want to do some error handling instead. You can do this by putting a Lookup Control on your form and putting a Jump in a macro. Here's how... Say you are jumping from a CUSTOMER record to an ORDER record keyed on CUSTOMER_ID. And say it is possible that you have a CUSTOMER with no ORDERs. On your CUSTOMER form, first create a lookup control, that looks in the ORDER table, keyed on CUSTOMER_ID. When asked if you want to save the value found, say YES and put it into a variable (for example, @var(34)). When asked what column to retrieve, select CUSTOMER_ID. When this form runs, the lookup control will fire. If there is an ORDER for the current customer, the current CUSTOMER_ID will be in @var(34). Otherwise @var(34) will be blank. The macro you would use to test the Lookup Control is:
|