Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a Record - Ignore Previous Thread
Message
 
 
To
14/08/2002 19:42:28
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00689787
Message ID:
00689789
Views:
22
This message has been marked as the solution to the initial question of the thread.
You misplased ELSE statement. It should be
IF mcheck = 0
	thisform.command2.Enabled = .t.
	mlcl_doc_nm = FoundNumber.doc_number
	if this.caption = "Save"
             .....
	     MESSAGEBOX('Changes have been saved.', 0+64+256,'Information')
        ELSE 
          * I don't know what code should be here
        ENDIF
ELSE
	messagebox ('Some of the fields on this form are empty.  Please complete the form.',0+64+256,'Information')
ENDIF
BTW, you can edit your messages if they didn't get any replies yet.

>Hi All:
>
>This is the click event of the Save button:
>
>
mlcl_doc_nm = FoundNumber.doc_number
>mrefdocdispname = thisform.combo1.DisplayValue
>mrefpatdispname = thisform.combo2.DisplayValue
>mToAddress = thisform.edit2.value
>mNotes = thisform.edit1.value
>
>IF mcheck = 0
>	thisform.command2.Enabled = .t.
>	mlcl_doc_nm = FoundNumber.doc_number
>	if this.caption = "Save"
>		update memos set Memos.FromDoc = mRefDocDispName,;
>			Memos.FromDocNum = mLCL_DOC_NM,;
>			Memos.ToWhom = mToAddress,;
>			Memos.NameOfPat = mRefPatDispName,;
>			Memos.HealthNum = mHealthCard,;
>			Memos.Contents = mNOTES;
>		WHERE Memos.MemoRefNum = EditThisReferralLetter.MemoRefNum
>		MESSAGEBOX('Changes have been saved.', 0+64+256,'Information')
>	 ELSE
>		messagebox ('Some of the fields on this form are empty.  Please complete the form.',0+64+256,'Information')
>	 ENDIF
>ENDIF
>
>Variable mcheck will be greater than 0 if any one of the fields is empty. A couple of the fields are memo fields and is being check as follows:
>
>
If empty(mNotes)
>    mcheck = mCheck + 1
>endif
>
>Problem: While testing I deleted the contents of a memo field (mToAddress) and on click Save - did get mcheck = 1, however, the messagebox after the ELSE in the IF Statement above did not fire. Further, the Changes were not made to the table also. No other error messages.
>
>Where am I going wrong? Thanks in advance.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform