Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Navigation causes a Uniqueness of Index violation Error
Message
From
06/02/2009 12:19:57
 
 
To
05/02/2009 16:58:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01379281
Message ID:
01379849
Views:
37
>I think I finally figured it out. The Navigation buttons always call the Find Valid method one I edit the fields. Is there a a way of not calling it in the Navigation buttons?

The code for the click method of the Edit event is
LLOCAL llenable

** Run click event in class

DODEFAULT()

** Set Form Mode

llenable							= This.Parent.RevertMode

** Enable/Disable Fields

IF Thisform.llfndrec AND This.Parent.RevertMode THEN
	Thisform.txtfindRelPoNo.Value  	= Thisform.currecvalue
	ThisForm.txtvendName.Value		= relpos.cvname
ELSE
       * nop
ENDIF

IF !This.Parent.RevertMode

	ThisForm.Recmovebtn1.Visible		= .T.
	ThisForm.txtFindRelPoNo.Visible		= .T.
	ThisForm.lblFindPoNo.Visible		        = .T.
	ThisForm.cboRelpoNoList.Visible		= .T.
	ThisForm.txtFindRelPoNo.Enabled		= .T.
	ThisForm.txtPoNo.Enabled			= .F.
	ThisForm.txtPoDate.Enabled			= .F.
	ThisForm.txtVendName.Enabled		= .F.
	ThisForm.txtOrderedBy.Enabled		= .F.
	ThisForm.txtDateRecieved.Enabled	= .F.
	ThisForm.txtDateReleased.Enabled	= .F.
	ThisForm.txtComment.Enabled		= .F.

	This.Parent.ButtonRefresh()
	ThisForm.Parent.AddMode			= .F.
	ThisForm.Parent.EditMode			= .F.
	ThisForm.Parent.RevertMode			= .F.
	ThisForm.cboRelpoNoList.Enabled	= .T.
		
	ThisForm.txtFindRelPoNo.SetFocus()
	ThisForm.lblstatus.Caption		= 'Viewing Data'
	
ELSE

	ThisForm.Recmovebtn1.Visible		= .F.
	ThisForm.txtFindRelPoNo.Visible		= .F.
	ThisForm.lblFindPoNo.Visible  		= .F.
	ThisForm.cboRelpoNoList.Visible		= .T.
	ThisForm.txtFindRelPoNo.Enabled		= .F.
	ThisForm.txtPoNo.Enabled			= .F.
	ThisForm.txtPoDate.Enabled			= .T.
	ThisForm.txtVendName.Enabled		= .T.
	ThisForm.txtOrderedBy.Enabled		= .T.
	ThisForm.txtDateRecieved.Enabled	= .T.
	ThisForm.txtDateReleased.Enabled	= .T.
	ThisForm.txtComment.Enabled		= .T.
	
	ThisForm.txtPoDate.SetFocus
	ThisForm.lblstatus.Caption			= 'Modifying Data'

ENDIF

ThisForm.SetTopEnd()
As I said before I need to not execute the valid method of the filed THISFORM.RECMDBUTNS which is where the Edit command (button) is./
When in edit mode the Add and Edit buttons are change to Save and Revert.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform