×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Setting autoyield to .F. causes problems in working code.

Setting autoyield to .F. causes problems in working code.

Setting autoyield to .F. causes problems in working code.

(OP)
I am using a third party Active X Control from DBI Technology called Solutions Schedule 3.0. I first wrote code to query a database and then fill in fields in the control. This code worked fine until I set autoyield equal to .F. Now the code fails with the following error...

Alias 'COLS' is not found. Line #43

Any suggestions would be helpful. Thanks in advance.

This is the section of code that is failing...

SELECT Collections.col_date, Collections.employeeno;
FROM park!Collections;
WHERE ALLTRIM(Collections.route) = ALLTRIM(Sched.route);
ORDER BY Collections.col_date;
Into Cursor Cols

If Reccount("Cols") > 0

Go top

Do While !EOF()

*** THIS LINE EXECUTES SUCCESSFULLY ****
nBarID = Thisform.ctSchedule1.AddKeyTimeBar(nIndexID, ;
0, ; 1440, ;
Thisform.numdate(Cols.col_date), ;
Thisform.numdate(Cols.col_date), 0)

*** THIS IS LINE # 43 WHICH GENERATES
*** "Alias 'COLS' is not found."
*** WHEN autoyield is set to .F.

cHHNum = SUBSTR(TRIM(Cols.employeeno), LENC(TRIM(Cols.employeeno))-2,3)
thisform.ctSchedule1.BarText(nIndexID, nBarID ) = cHHNum
thisform.ctSchedule1.BarTextAlign(nIndexID, nBarID ) = 2

nCount = thisform.ctSchedule1.AddBarStyle(20, 0)
thisform.ctSchedule1.StyleBackColor(nCount) = RGB(0,255,0)
thisform.ctSchedule1.BarStyle(nIndexID, nBarID ) = nCount

SKIP IN Cols
ENDDO
ENDIF

RE: Setting autoyield to .F. causes problems in working code.

The code looks correct. The only thing I can see is that your are using a FoxPro Reserved word COLS. Change the cursor database name and try it again.

RE: Setting autoyield to .F. causes problems in working code.

(OP)
After setting autoyield to .F. the call to Thisform.ctSchedule1.AddKeyTimeBar
caused an event to be fired which was not being fired previously. Within that
event CLOSE TABLES and CLOSE DATABASE were executed. So after
returning from Thisform.ctSchedule1.AddKeyTimeBar with autoyield set to .F.
the CURSOR Cols was no longer available.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close