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

set relationship in a form with multiple tables in a dbc 1

Status
Not open for further replies.

sncheong

Programmer
Jan 18, 2001
47
NZ
i need some help on this please. i have 4 tables in a dbc ie
sales.dbf cdx custid,prodid and agtid,
customers.dbf cdx custid,
products.dbf cdx prodid and
agents.dbf cdx agtid.

i tried setting the relationship in the data environment with
select sales
set relation to custid into customers
set relation to prodid into products additive
set relation to agtid into agents additive
select customers

when i run the form, the error message is "customer is not related to the current workarea". i would like to know what happens here and how i can solve it? ta.

i've tried adding set skip to customers but it didn't solve it.


 
According to the help files, here's the error you get:

"field" is not related to the current work area (Error 1165)
You have issued a command that requires a relation in order to exist.

If you use the debugger, does the error occur on a specific line of code? If so, what is the line?
 
select customers
set relation to custid into Sales
select sales
set relation to prodid into products additive
set relation to agtid into agents additive
SELECT Customers

The above code could solve your problem.

The problem you face is, because, Sales is related to the other DBFS and when the pointer you move in Sales record will move the record pointers in other DBFs. Whereas you are trying to move the pointer in Customer DBF which is not related to the other DBFs. Once the relationship is set, always move the pointer in the parent and the related DBFs (children) DBFs shall follow the relationship and shall not be set by programme.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
hi, my apologies, a typo there. the last line s/b select sales but i am still not getting the result. i needed to display field in the other tables apart from those in the sales table. perhaps you can give an sample code. ta very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top