Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for duplication
Message
From
22/06/1999 03:19:27
Upendra Nayak
Cadsys Technologies
Mumbai, India
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Checking for duplication
Miscellaneous
Thread ID:
00232354
Message ID:
00232354
Views:
37
Subject : Misbehaving application

Dear Universalthread user's

I am trying to create a simple data entry module which
has a formset with toolbar to navigate (HOME,END,NEXT,PREVIOUS,SAVE,DELETE,UNDO,CLOSE).

(Home,end,next,previous,save,delete,undo & close)
works perfectly. But the problem start with key field
validation which does not check for duplication. I
have also reindex and recreated index file to check
index file corruption.

e.g.

e.g i have a file (fname c 20) and i want it to be
unique (i.e. no duplication entry).

I have only one TEXTBOX on the form with
controlsource = fmast.fname

I have created index file on upper(fname)

The valid function for the textbox is a shown below:
**************
if lastkey() = 27
return .t.
endif

if empty(this.value)
messagebox("File name cannot be empty.",32,"Alert !!")
return .f.
endif

Select fmast
xrecno = recno()
this.controlsource = ""

Select fmast
set order to 2
seek alltrim(upper(this.value))
if found() .and. recno() # xrecno
messagebox("This File name already exsist.",32,"Alert !!")
goto xrecno
this.controlsource = "fmast.fname"
=tablerevert(.t.)
this.refresh()
return .f.
endif
goto xrecno
this.controlsource = "fmast.fname"
this.refresh()
return .t.
*********************


I am also suprised to note that tasmania traders sample in VFP 6.0
does not have any duplication check on it key fields.

e.g
1. In Customer module one can have two customer with same name.
2. In product master one can have two product with same name.
3. In Employee master one can have two employees with same name.

Secondly there in no deletion option provided in the above sample.

Is there any limitation on using following functions:

cursorsetprop('Buffering',5,'fmast')
tableupdate()
tablerevert()

Kindly let me know where i must have gone wrong.

with regards
(U.D. Nayak)
Email : bilav@vsnl.com
Next
Reply
Map
View

Click here to load this message in the networking platform