Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CTRL+F within a grid?
Message
 
To
14/06/2000 09:22:26
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00380149
Message ID:
00380171
Views:
14
I keep getting "Invalid table number" error

This is a new one to me, any ideas?

Thanks
Stephen McLaughlin

LPARAMETERS tcAlias, tuSearchVal, tlMatchWholeField
LOCAL laFields[1], lnFieldCnt, lnField, llMatchFound, luCompVal
*** Make sure passed alias is available
IF ! USED( tcAlias )
USE ( tcAlias ) IN 0
ENDIF
*** Get the field names
lnFieldCnt = AFIELDS( laFields, tcAlias )
SELECT ( tcAlias )
*** Scan the table
SCAN
*** look for a match in each field
FOR lnField = 1 TO lnFieldCnt
luCompVal = IIF( INLIST( VARTYPE( EVAL( lafields[ lnField, 1 ] ) ), 'C', 'M' ), ALLTRIM( EVAL ( laFields[ lnField, 1 ] ) ), EVAL ( laFields[ lnField, 1 ] ) )
llMatchFound = .F.
IF tlMatchWholeField
IF tuSearchVal == luCompVal
llMatchFound = .T.
EXIT
ENDIF
ELSE
IF INLIST( VARTYPE( EVAL( lafields[ lnField, 1 ] ) ), 'C', 'M' )
IF tuSearchVal $ luCompVal
llMatchFound = .T.
EXIT
ENDIF
ENDIF
ENDIF
ENDFOR
IF llMatchFound
EXIT
ENDIF
ENDSCAN
IF llMatchFound
MESSAGEBOX( 'Match found in field: '+laFields[ lnField, 1 ]+CHR(13)+ 'Record Number '+ALLTRIM( STR( RECNO( tcAlias) ) ) )
ENDIF
Stephen McLaughlin
"Sexy Steve Valenteno", "Blastmaster"
stephenmclaughlin@gmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform