Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with sorted table
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00546949
Message ID:
00546958
Views:
14
>>Hi everybody,
>>
>>I have a table, which is sorted by upper(State+OwnerCity+OwnerStrt+...). I have a button on my form called Manual Match, which allows to overwrite data with data from Streets lookups. This is a code fragment from this button:
>>
>>	if m.llPerform
>>		replace OZipped with "M", ModiType with "C", ;
>>			OwnerCity with proper(Streets.City), ;
>>			OwnerState with Streets.State, ;
>>			OwnerZip5 with Streets.zip_code, ;
>>			OwnerPlus4 with Streets.zip4, ;
>>			OwnerCr_rt with Streets.carrier_rt, ;
>>			OwnerStrt with proper(Streets.street) in BldMstr
>>		if !eof()
>>		   skip
>>		else
>>		   if !bof()
>>		      skip -1
>>		   endif
>>		endif
>>		this.parent.parent.refresh()
>>		.freshen()
>>		.nManualProcessed=.nManualProcessed+1
>>		.nProcessed = .nProcessed + 1
>>	endif
>>
>>I found, that if I change data in Street with the Street, which would be next in sequence, I move to the same record. E.g. I have Wescott Rd, I change it to West St. and I'm sitting on West St. again after skip. I want to move to the following record instead. How can I simply achieve the desired behavior?
>
>Sounds like the index tag is active. When the key fields in the table are updated, the index is automatically changed to reflect this. Off the top of my head, on workaround might be view. However, in this case, a non-data bearing primary key would be required to properly update the records.

Thanks, George. I seemed to solve this problem with the new form method called MoveNextRecord:
********************************************************************
*  Description.......: AddressForm.MoveNextRecord
*  Calling Samples...:
*  Parameter List....: tnRecno
*  Created by........: Nadya Nosonovsky 08/21/2001 03:44:58 PM
*  Modified by.......:
********************************************************************
lparameter tnRecno
if !eof()
     skip
     if recno()= m.tnRecno && we're still on the same record
          if !eof()
               skip
          else
               if !bof()
                    skip -1
               endif
          endif
     endif
else
     if !bof()
          skip -1
     endif
     if recno()= m.lnRecno && we're still on the same record
          if !bof()
               skip -1
          else
               if !eof()
                    skip
               endif
          endif
     endif
endif
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