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!

Need Advice On Displaying Data From Three Tables On A Form

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
I'm new to FoxPro- No data controls like VB. I have a form that displays all of the fields from a main table- and three more values in two other tables.

There are two fields in the main table used to track a file, Referred_From & Assigned_To. These two fields store codes that relate to a 2nd table containing two fields- a Worker_ID and the Worker_Name assigned to that ID Number.

There is another field in the main table for Reason_Code. This field relates to the 3rd table containing two fields- Reason_Code and the Reason_Description for that code.

I have a form that has a text box for each of the fields in the main table. The three fields with the codes each have a label next to them on the form. I want to display the name or description from the other tables that relates to these codes in these labels on the form.

I want these labels to update when a user changes the code next to it on the form.

Questions:

1) Is a view the way to go and requery on the Lost_Focus Event whenever a change to one of these code fields occurs? Would it be possible/better to use a cursor or SQL? Details please.

2) Would disabeled text boxes provide any benefit over using labels?

Thanks

 
I suppose the most direct route is to use relations. The records dispalyed on your form will update when they recieve focus.
-Pete
 
Oops didn't see #2.

Yes use textboxes. They can be bound to data and it will automate your display update as you navigate the datbase.

-Pete
 
Just as Pete said, check out the help topic
"SET RELATION TO".

You will have to index your child table to set a relation.

A relation will be set to allow you to show a one-to-one or a one-to-many relation.

Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top