Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rowsource problem 2

Status
Not open for further replies.

vfpgolfer

Programmer
Oct 16, 2004
76
US
I have a program where I create a cursor readwrite then put into a combo as follows:
WITH THISFORM.esipageframe1.draft
.combomajorclfilter.STYLE=2
.combolawyerfilter.ROWSOURCETYPE=6
.combolawyerfilter.ROWSOURCE="sellawf.id,initials"
.combolawyerfilter.LISTINDEX=.combolawyerfilter.LISTCOUNT
.combolawyerfilter.REFRESH()
ENDWITH

later in the program I refresh the combo (in case of changes) by redoing the select into the cursor then re-executing the above code.

I get error cannot access the selected table

I put brow after the select and wait window after the .rowsource to verfiy where it was happening - is it necessary to clear the combo first? (.rowsource="" etc.?
 
Yes.

boyd.gif

SweetPotato Software Website
My Blog
 

Vfpgolfer,

This is a documented behaviour.

From the Help for Error 1152:

This error can occur under the following conditions:

A table or cursor that is specified for the RowSource property of a ComboBox or ListBox control is closed.

If you want to close a table or cursor that is specified for the RowSource property of a ComboBox or ListBox control, perform either of the following actions prior to closing the table or cursor:

Set the RowSource property to an empty value ("").
-OR-
Release the form containing the ComboBox or ListBox control.


Hope that helps.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks guys - I put that (rowsource="") before the new second select and no more errors.

Help from two of the best is always appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top