Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is out of range error
Message
 
 
To
25/09/2013 04:37:51
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01584061
Message ID:
01584070
Views:
54
>Hi,
>I have a form for user to input the customer code and then load their inventory lot record to the cursor.
>I created a method to load the records from a file to the cursor and use in
>the combobox control.
>First or second time to call the method are no error, but sometime, randomly happend "Record is out of range" error when
>run to the statement -> thisform.cboCusLotNo.ControlSource = "curCustLot.cuslotno"
>
>Please advise.
>Derek
>
>
>* load_recrod()
>IF USED('cusfile')
>    SELECT cusfile 
>    USE
>ENDIF 
>USE cusfile IN 0 ALIAS cusfile NOUPDATE    
>SELECT cusfile
>SELECT * FROM cusfile INTO CURSOR curCustLot ORDER BY cusfile.cuslotno
>SELECT curCustLot
>thisform.cboCusLotNo.ControlSource = "curCustLot.cuslotno"
>thisform.cboCusLotNo.RowSource = "curCustLot.cuslotno,itmcode,bal"
>thisform.cboCusLotNo.ListIndex = 1
>thisform.cboCusLotNo.Refresh()
>
Try adding NOFILTER into your select statement. Also, I rarely use fields for the RowSource Finally, why do you use the same cursor for ControlSource and for the RowSource? They should be from different tables (cursors), you can not use the same cursor for both row source and control source.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform