Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is in use by another user
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00659506
Message ID:
00660434
Views:
16
>>In this particular application users work with buffered table directly ... I can post code here if you think, it might be relevant.
>
>Are You getting useful hints from the others or still stuck with
>the problem?
>
>If the latter, I really think You should provide some code
>(at least to have something to stare at <g>)

Hi Frank,

I believe, it would be helpful if you and others look into the code as well:

AddrInGrid - textbox class based on the regular textbox used instead of text1 in the grid:
********************************************************************
*  Description.......: AddrInGrid.GotFocus
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........:  
*  Modified by.......: 
********************************************************************
with this
	if .parent.readonly
		set cursor off
	endif
	if lower(.parent.parent.name)=lower('grdBldMstr')
		.forecolor=AddrStat.custColor && this.parent.parent.myForeColor(evaluate('BldMstr.'+thisform.AddrField))
	endif
	store .parent.parent.cCurRecBackColor to .backcolor
*	.selectedbackcolor = .parent.parent.cCurRecBackColor
*	.selectedforecolor = .parent.parent.cCurRecForeColor
	.fontbold=.t.
	.OldValue=.value && Save the current value
	with .parent.header1
		.backcolor=rgb(64,128,128) && green
		.forecolor=rgb(255,255,255) && white
	endwith
endwith
********************************************************************
*  Description.......: AddrInGrid.InteractiveChange
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........:  
*  Modified by.......: 
********************************************************************
local lcSource
lcSource=upper(justext(this.parent.controlsource))
if inlist(m.lcSource,'STREET','OWNERSTRT') 
	thisform.UpdateStreetPosition(this.value)
endif
********************************************************************
*  Description.......: AddrInGrid.LostFocus
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........:  
*  Modified by.......: 
********************************************************************
set cursor on
with this.parent.header1
	.backcolor=rgb(192,192,192) && gray
	.forecolor=rgb(0,0,0) && black
endwith
local lcSourceTable, lcFieldName
with this
	if not (.readonly or .parent.readonly or .parent.parent.readonly)
		lcFieldName=justext(.controlsource)
		lcSourceTable=juststem(.controlsource)
		if !empty(m.lcFieldName) and !empty(m.lcSourceTable)
			if .value<>.OldValue && value was changed
				if empty(.value)
					if .lEmptyNotAllowed && for Street field, for example
						=messagebox('This field could not be empty!',48, 'Revert')
						.value=.OldValue
					else
						if type(m.lcSourceTable +'.PropID')='N' ;
								and evaluate(m.lcSourceTable +'.PropID')>0 && Linked record
							if !inlist(lower(thisform.ProcType),'trxnproc','prclproc')	
								replace (m.lcFieldName) with .null., ModiType with 'C' ;
									in (m.lcSourceTable)
							endif	
						endif				
					endif
				else && new not empty value
					replace ModiType with 'C' in (m.lcSourceTable)
				endif
				.parent.parent.UpdateStatus(m.lcFieldName) && Value was changed
			endif
		endif
	endif
endwith

***********
Methods for the grid:
********************************************************************
*  Description.......: GrdAddrStd.UpdateStatus
*  Calling Samples...:
*  Parameter List....: tcSourceFld
*  Created by........: Nadya Nosonovsky 07/26/2001 11:52:31 AM
*  Modified by.......: Nadya Nosonovsky 07/31/2001 02:37:00 PM
********************************************************************
lparameter tcSourceFld
if vartype(m.tcSourceFld)<>'C' or empty(m.tcSourceFld)
	tcSourceFld='street'
endif
local lcAddrField
with thisform
	lcAddrField=lower(.AddrField)
	store .t. to .lOkChangeStatus, .lFieldChanged
	if evaluate('BldMstr.' + m.lcAddrField)='5' && Auto_Suspect
		do case
		case m.lcAddrField='addrstats'
			.lOkChangeStatus=.ValidateStreet(BldMstr.Street,'street') && Don't change status to manually resolved for invalid streets
		case m.lcAddrField='addrstato'
			.lOkChangeStatus=.ValidateStreet(BldMstr.OwnerStrt,'ownerstrt') && Don't change status to manually resolved for invalid streets
		endcase
	endif	
endwith
********************************************************************
*  Description.......: GrdAddrStd.AfterRowColChange
*  Calling Samples...:
*  Parameter List....:
*  Created by........:
*  Modified by.......: Nadya Nosonovsky 12/12/2001 02:35:39 PM
********************************************************************
lparameters nColIndex
local lnReccount, lnRecno
lnReccount=reccount('BldMstr')
lnRecno=recno('BldMstr')
with thisform	
    .lockscreen=.t.
	if this.nCurRec<>m.lnRecno	    
		if .lFieldChanged and .lOkChangeStatus    		
		   .lockscreen=.t.
		   goto this.nCurRec in BldMstr
		   replace (.AddrField) with '6', ModiType with 'C' && Manually-Resolved		   
		   goto m.lnRecno in BldMstr		   
		   this.refresh()
		   	store .f. to .lFieldChanged, .lOkChangeStatus
		endif
		if .ProcType='prclproc' and .SubProc='ppsitus' and not .lShowStateAddress
			.RequeryGridSources()
		else
			.UpdateStreetPosition()
		endif	
		.NavStand.navUpdate()		
		.edtNotes.refresh()
	endif
	this.statusbartext=space(20)+"Record "+ transform(m.lnRecno)+" of "+ ;
		transform(m.lnReccount)+ " in BldMstr (Total number of records to process " + ;
		transform(.nRecords) + ")"
	if !empty(.BusMode) and .BusMode = "Situs"
         .swtch1.ChangeTown(iif(vartype(oJC)='O',oJC.CurState,"MA"),BldMstr.Town)
     endif	
   	if !empty(.BusMode) and .BusMode = "Owner"
         .swtch1.ChangeTown(BldMstr.OwnerState,,BldMstr.OwnerCity)
    endif	 
    this.nCurRec=m.lnRecno
    .lockscreen=.f.
endwith
*dodefault(m.nColIndex)
Grid is based on Highlighted grid by Cetin Basoz. The error seems to ocur mostly for "Suspect" records, e.g. if I change status to Manual-Resolved, I'm able to make changes, otherwise - no.

Also behavior is exactly similar to what we should have with SET REPROCESS TO 0 (we don't change default VFP setting in our BaseForm class).

E.g. if I test this application in standalone mode (without Error Handler), it looks like it hangs on the record. Only pressing ESC gives me an error message 'Record is in use'... So, it behaves exactly like it described in the SET REPROCESS command help... However, I tried different settings and it still gave me the error...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform