Page 1 of 1

Searcing without moving record pointer

Posted: Mon Mar 23, 2009 3:50 pm
by sudip
Hi,

Can anyone help me to search a lookup table (say Item) without moving record pointer of lookup table?

Regards.

Sudip

Re: Searcing without moving record pointer

Posted: Mon Mar 23, 2009 7:31 pm
by esgici
sudip wrote:Hi,

Can anyone help me to search a lookup table (say Item) without moving record pointer of lookup table?

Regards.

Sudip
Hi Sudip

I am afraid that I can't understand your question.

By definition, only one record can be active at a time in a table. When you begin a lookup ( by FIND, SEEK, LOCATE, CONTINUE or anything else) record pointer will change to searched record if found, else to LASTREC() + 1. This is logic of lookup, it isn't?

If you want don't lose record pointer before lookup, you can store it into a variable.

I don't know this help to you.

Regards

--

Esgici

Re: Searcing without moving record pointer

Posted: Tue Mar 24, 2009 3:48 am
by sudip
Hi Esgici,

Thank you for your help.

I am now telling the particular problem, why I need this.

It is required for foreign key data integrity. Suppose sale table has a foreign key for customer code. Our user is using the sale form. Now he/she opens customer setup form, where he tries to delete a customer from customer master file, which was setup erroneously. Before deletion, software should look up foreign key reference of sale table. But, in this case sale table record pointer will be moved from the previous location and sale form will face problem.

Now how to solve this.
1) Sale Form: Using memory variable for each field and during update/refresh it will seek the primary key of the sale table.
2) Customer Form: Before looking up to sale table, sale record number should be stored in a temporary variable and after search is over move record pointer of sale table to previous location.

Now for 2nd case, it will be very helpful if record pointer is not moved.

BTW, is there any way to open private data session for a form? I got this idea from another software tool (VFP). (I know many of our friends have allergy about Microsoft, but it's a good feature ;) )

With best regards.

Sudip