Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bebot Chan
  Where is Bebot Chan?
 Riyadh
 Saudi Arabia
 Bebot Chan
 To: Paul Brown
  
 York
 
 Paul Brown
 Tags
Subject: RE: Check if This Name Already Exists in the Table
Thread ID: 21755 Message ID: 21823 # Views: 22 # Ratings: 0
Version: Visual FoxPro 5 Category: Forms
Date: Wednesday, April 02, 2003 1:48:22 PM         
   


> > Dear Friends,
> >
> > I had been using SCATTER MEMVAR BLANK in a form to enter/edit Buyers data. But then somebody suggested me to use
> > TableBuffering instead. I dont know what is the benefit of using TableBuffering over the my previous method of using
> > Scatter Memvar and then Gather. But anyway I tried out in one of my forms.
> >
> > The problem is that in first field that is BUYERS NAME , I want to put a check that the Value to be entered should not be already
> > existing in the database.
> >
> > How can I check it while using tablebuffering. I dont want to use the candidate index, because I dont want to force it, but just want
> > the user to know that this name already exists in the database.
> >
> > Can somebody help
> >
> > Sudhir
>
>
> Hi
>
> Assuming there is an index on the field you are checking, use the INDEXSEEK() function. If you do not have an index you will have to either do an SQL Select statement or open the table again with a new name and LOCATE in that table (i.e. USE YourTable AGAIN ALIAS MyLookup)
>
> HTH
> Paul


Sudhir,

I would not link the control source of the textbox which requires the customer's code to the cursor/table. This way, it is independent and you can run your own routine to test for its existence like SEEK( ). The only problem is, since it is not linked to the cursor, when the record moves, that particular textbox control is not updated. You have to code it manually like THISFORM.txtCustomerCode.Value = Customers.Code and REFRESH.

Bebot





COMPLETE THREAD

Check if This Name Already Exists in the Table Posted by sudhir uppal @ 4/1/2003 10:00:56 AM
RE: Check if This Name Already Exists in the Table Posted by Paul Brown @ 4/1/2003 2:28:14 PM
RE: Check if This Name Already Exists in the Table Posted by Bebot Chan @ 4/2/2003 1:48:22 PM