Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 Combo Box Questions
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
VFP6 Combo Box Questions
Miscellaneous
Thread ID:
00193294
Message ID:
00193294
Views:
50
Please pardon me if these are dumb questions. I'm still struggling my way up the learning curve with VFP6. I've read through most of the relevant online docs (several times) but haven't made much sense out of these problems. The online docs only seem to deal with the obvious....

I'm trying to create a form with company and contact information which will eventually become part of a much larger parts inventory management system for a small electronics manufacturing company.

Background:

The underlying tables relevant to this form include the company information table, a table for contact people, and a table describing the types of organizations (client, distributor, manufacturer, retail vendor, etc.). The relationships between the indexes are:
Company (one) to contacts (many) - one company may have several persons for contacts;
OrgTypes (one) to Companies (many) - one company will be one of the OrgTypes, but each OrgType can apply to many companies. A type ID code will be stored in the companies table corresponding to the type instead of typing in the words each time.

This form will have Company name, address, etc. information and a grid for the names of various people within the organization. In addition, a field for the OrgType should have a drop-down list or combo box to select the type of organization when entering info on a new company.

I would like to use a combo box for the company name to permit quick lookup by picking from the list. . I believe the Combo box is required to permit entry of text when new company data is being entered. Text boxes show the remaining company data except for OrgType

I would also like to use a combo box for the OrgType field. It should
display the current type for the currently selected company record. New company entries should display the type descriptions, then enter the corresponding code into the companies table when selected. It should also permit creation of new OrgType if a suitable one does not currently exist.


The problems:

1. When several entries exist in the 'people contacts' table that
correspond to a single company, the 'Company name' combo box displays that company name multiple times. How can I get it to display only once?

2. Adding new companies: I created a command button which appends a blank record to the companies table (which calls a newID function for the key field) and refreshes the form. When I attempt to enter text into the combo box, data from a different record appers with the first keystroke. With each additional keystroke, one letter at a time appears, then disappears. Nothing is entered in the target fields. In addition, I'm not confident that the record pointer is pointing at the newly appended record. I tried "go top" and "go bottom" and got conflicting results each time, still with the above described behavior.

3. I'm not sure how to handle the OrgType lookup field. The relationships seem to make it a parent of the companies table, which is a parent of the contacts table. However, it is not the primary table, as I am using it as a lookup list for the companies table. Any suggestions on how to make it do what I want?

4. Finally, are there any sources of real information on using these
controls? If it's in the docs, it's so buried that I haven't been able to find it in over a month of full-time digging.

Any help would be greatly appreciated! (As would an email copy of your reply post.)

Thanks very much,
Neil Preston
Next
Reply
Map
View

Click here to load this message in the networking platform