Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetNextModified and newly added record
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
GetNextModified and newly added record
Miscellaneous
Thread ID:
00713585
Message ID:
00713585
Views:
58
Hi everybody,

Update Solved by adding
if pemstatus(thisform, 'lSomeChanges',5) and not empty(this.value)
   thisform.lSomeChanges = .t.
endif
In textbox class LostFocus() [on this form I use only textboxes] and checking this property instead of GetNextModified().



In DataEntry form I add a new blank record starting the form and after each Save/Cancel. My Close form code looks like this:
local llReturn, lnModified, lnResp
llReturn = .t.
with thisform

*:Delete any other blank records
*		delete for recnum = 0
	do case
	case not .EditMode or not .RefreshPf1.visible or empty(.txtSource.value)
&& No validation
	otherwise
		llReturn = .FormValid()
	endcase

	if m.llReturn
		select BldMstr
		lnModified=getnextmodified(0)
		if m.lnModified<>0
			lResp=messagebox('Do you want to save changes?',36,'Save?')  &&+32
			if m.lResp=7  && User requested that changes not be saved.
				=tablerevert(.t.)
			else
				=thisform.doTableUpdate() 
			endif
		endif
		thisform.release()
	endif
endwith
The problem is, that I get this question every time, even if I just open the form and close it. How can I find out, that I really made changes and not ask this question every time?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform