VFP, one-to-many write table problems

Posted on 2010-09-15
Last Modified: 2012-05-10
I'm working in VFP 9.0 SP2.  I have a one-to-many program which is writting blanks fields for the many items into the one table. I have two tables:  

table "ORDERS" which holds the customer info.

table "ITEMS"  which holds the item info.

When I go to save the information I  SELECT ORDERS, find & increment the last order number and append a record with the customer data.

Then I  SELECT  ITEMS  and append the items info using this code.


In the ORDERS table I am see the first row filled with the correct customer info. and I have additional rows filled with ***************** for each of the items. I was expecting to see only one row entry for each order in the ORDERS table.  It is acting like the tables are linked, but I am working with them individually.

If I have four items in an order the ORDERS table looks like this:

cust_name    |   cust_add     | cust_phone   | ......
****************|******************|*****************|  .........
****************|******************|*****************|  ..........

Question by:jws2bay
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 29

Accepted Solution

Olaf Doschke earned 500 total points
ID: 33684563
You see such linked tables and *** for the parent records, if SET SKIP is set. As there is only one order item you only see one row filled with it other rows are filled with *** as placeholder.

Bye, Olaf.

Author Comment

ID: 33685228

Thanks for the help
LVL 42

Expert Comment

ID: 33696939
jws2bay, I don't know why you are not patient enough to wait for an answer to your question...

This is just a brief list of possibilities how to solve your one to may report problem.

You have several options one of them is to create the report for Ordered_items table and establish a relation from ordered_items to Customer. The report should have group band for Customer data and detail band for Ordered_items data:

USE Customer ORDER TAG web_order
USE Ordered_items ORDER TAG web_order

SET RELATION TO web_order INTO Customer

REPORT FORM YourReport ...

Another possibility is to create a query

SELECT * FROM Customer, Ordered_items ;
  WHERE Customer.web_order = Ordered_items.web_order ;

Above query creates two differently named columns for web_order. So, you probably should use a slightly modified report.

The view usage is similar to the query.

The last option could be e.g. Report Wizard which will allow to create the report in a minute including all relations.
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

LVL 29

Expert Comment

by:Olaf Doschke
ID: 33698946

an answer has already been given and accepted.

Bye, Olaf.
LVL 42

Expert Comment

ID: 33701179
Sorry Olaf, this is nothing against you and no correction to your answer. Your answer is perfect and points were assigned correctly.

My last post here was a reaction to another already deleted question...

jws2bay's speciality is to ask a question, wait one hour, and delete the question just in the time when I am working on the answer, testing it etc. I have to stop doing such mistakes...

But if the answer is already created why to put it into the trash? So, I've posted it here.


Author Comment

ID: 33705986

Sorry, I was quick on the draw.  I can understand the frustration of composing the answer and then not having the chance for it to be considered.

I had not considered putting the report together with the Customer as the group band, and the item data in the detail band. I'll have to try this out.

Thanks for the answer.
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33707879
I see, haven't seen the other question at all.

I also tend to create and test samples, but lately also often keep it at pointing to the reason, often that's sufficient already.

Bye, Olaf.  

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cannot locate the microsoft visual foxpro support library 6 649
one to many join on two fields vfp 2 698
Print a word document in Visual Foxpro 1 689
VFP9 in Windows 10 9 418
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: (http://msd…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question