Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Displays Records Before a Selection is Made
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117567
Message ID:
00117639
Views:
17
Chuck,

>How come, when the form is ran, records are displayed in the Grid even before an employee number is selected out of the combo box?

It sounds like the grid is probably displaying the child records for whatever parent table record you are pointing at when the form starts up. If you cbo is not bound to a parent table field then it'll show up empty or to whatever value you initialize it to. You can set the cbo.Value to reflect the first parent table record.

>I'm building a rather simple application wherein I am working with two tables: Vac.dbf (Vacation data) and Prlink.dbf (a master employee file). Vac just contains data like hours earned, hours taken, and employee number. Prlink contains employee number, employee names, and other important info about each employee. In the Data Environment of my form, I have drawn a line between Prlink.employee_nmbr field and an index named "nmbr" in Vac. Vac is INDEXed ON nmbr+DTOS(date), so that the records should appear in ascending date order.
>
>I have created a grid populated with fields from Vac. I have provided a combo box for the user to select an employee from. The combo box RowSource is Prlink.nmbr,fname,lname. In the ValidEvent of the combo box I have the code: ThisForm.Refresh(). Also, I have set the following properties in the Grid: ChildOrder: Nmbr; LinkMaster: Prlink; RelationalExpr: Nmbr. I don't know if I did this right, or even if it was necessary after setting the relation in the DE of the form -- would appreciate verification.
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform