>I keep getting an error telling me the table has no index set, but I thought by using the seek and setting the order to cshipno it wouldnt be a problem? There is probably a simple answert for this...TIA!!!
>
>SELECT a_arcadr
>GOTO top
>SEEK (ALLTRIM(thisform.combo1.Text)) ORDER cshipno
>IF FOUND()
>
> thisform.scompany.Value = company
> thisform.saddress1.Value = saddress1
> thisform.saddress2.Value = saddress2
> thisform.scity.Value = scity
> thisform.sstate.Value = sstate
> thisform.szip.Value = szip
>ELSE
> WAIT WINDOW "customer address not found"
>ENDIF
You are mixing SEEK as a command and SEEK() as a function.
A better usage would be:
SELECT a_arcadr
SET ORDER TO cshipno
IF SEEK (ALLTRIM(thisform.combo1.Text))
thisform.scompany.Value = company
thisform.saddress1.Value = saddress1
thisform.saddress2.Value = saddress2
thisform.scity.Value = scity
thisform.sstate.Value = sstate
thisform.szip.Value = szip
ELSE
WAIT WINDOW "customer address not found"
ENDIF
Another issue is that you are SEEKing an ALLTRIM() of a value. That may or may not work correctly depending on settings.
It is important not to create an index (INDEX ON) on ALLTRIM() as it could produce unpredictable results.
See:
SET EXACT
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html/5ac68f23-c330-42c4-a4a3-c38f7278b22a.asp?frame=trueString and Value Comparison in Visual FoxPro
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html/31f9c8c3-414e-4930-aa7f-2239f07b19e6.asp?frame=true