Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Relation Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00281166
Message ID:
00281286
Views:
12
Paul,
Why don't you alter the behavior of the text boxes such that they check to see if child table(s) is at EOF and if so they change their text to empty strings. An appropriate place for this check might be when the record pointer moves in the parent table.
Good Luck.

>Hi Dore,
>
>Yes, actually the grid that shows the child table is blank which is great but we have some text boxes where the controlsource is the child table and these text boxes have data from the last record in the table.
>
>Is this what is supposed to happen? I would think that if there is no child record then no data should show in the textbox.
>
>Thanks,
>Paul
>
>>Actually, the record pointer is moved to the record one past the last record in the child table. This record is also call end-of-file or EOF (and as you would expect there is a corresponding beginning-of-file or BOF). It can be tested by checking the value of EOF('childtable'). Since this record (beyond the last one) really doesn't exist all of the field values in it are empty. Where (e.g. a textbox) does the non-empty invoice field show up on the form? You could always make showing it dependent upon !EOF('childtable') though that should be its normal behavior.
>>
>>>I have just begun using the set relation commands for relating parent and child tables. This works fantastic except if you don't have any matching child records for the current parent record. If there aren't any matches in the child table then the record pointer is moved to the last record in the child table which can show incorrect data on a form.
>>>
>>>For example, if I have a customer history form and I set a relation between the customer and the invoice tables, I could go into a customer that doesn not have any invoices but one will still show, the last invoice in the table.
>>>
>>>Is this correct? Is there a way around this? The desired result would be if there aren't any child records don't show ANY records.
>>>
>>>Thanks,
>>>Paul
Previous
Reply
Map
View

Click here to load this message in the networking platform