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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table relationship

Status
Not open for further replies.

ogab

Technical User
Mar 15, 2001
2
US
i have the following code on a form that runs a queery for me, i get an error msg that said " cannot find varrible deptssan" and a second error msg that states " tables are not indexed" i check the data envoriment and the tables "tempquerry 6", "dept" and "last work" seem to have no relationship i think they were deleted. can anyone help me fix this problem.


SELECT dept, name, ssan, phone, ;
street, cityzip, pay, bill, start_date, tax ;
FROM tmpQuery6 ;
WHERE deleted() = .t. ;
INTO TABLE tmpQuery7.dbf

******* find cleartext for dept name ******
SELECT dept
LOCATE for dept = m.department
m.deptClear = dept.name
SELECT tmpQuery7

********** fill with blank lines ********
go bottom
m.numRecords = recno()

IF m.numRecords < 21
numLines = 21 - m.numRecords
ELSE
numLines = 21 - (MOD(m.numRecords, 21))
ENDIF

FOR loop = 1 TO numLines
append blank
ENDFOR


********* print the report *********
set deleted on
set order to
report form sign_in.frx to print prompt noco
set deleted off
thisform.release

*********** update lastwork.dbf *********
SELECT tmpQuery7
INDEX ON ssan TO ssan
SELECT lastwork
SET RELATION TO Lastwork.ssan INTO Tmpquery7 ADDITIVE
REPLACE last_work WITH m.eventDate ;
FOR lastwork.dept == tmpquery7.dept
SET RELATION TO


select tmpquery
use
select tmpquery2
use
select tmpquery3
use
select tmpquery4
use
select tmpquery5
use
select tmpquery6
use
select tmpquery7
use


 
1. Your memvar deptssan was not addressed in your code so I ASSUME:
a. It is a database/table/field name and some one removed the alias
1. alias.deptssan or
2. someone removed the &quot;.&quot; between dept.ssan

When you set a relation you need indexes and you did not post any code for that . Example
Use dept
set order to dept
select TmpQuery7
set relation to TmpQuery7.dept into dept.
You have no code for that posted.
or
The relation and index was set in the report enviroment and someone did you a favor and change the report or the report enviroment or the database relationship. David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top