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.
Industry Leaders: 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!

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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

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…
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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