Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box question and other questions related to form
Message
 
To
05/11/1997 16:49:48
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00058490
Message ID:
00058534
Views:
27
To C.L. Chu (via Edward, thank you)

>>I am creating a form which has 6 combo boxes referring to the same dictionary.
>>However, since there are 5,000 + records in that dictionary, the form shows up
>>very slowly. I would like to know whether there is any way I can speed up
>>the program?
>
>I don't know what you are displaying in the comboboxs. It sounds like they may be logically broken up into 6 catagories. If this is true, you might want to make your RowSourceType a view or SQL, then write an SQL statement to populate the combobox with only the records you want. If all comboboxs need to see all 5,000 records, then you might want to place a Option group on your form to lessen the chioice set Eg. Option1 - A-F, Option2 G- M. THis way you can write an SQL staement based on these selections and reduce you selection set.

Also, if you are using AddItem() to fill your combo boxes this will slow your form-loading a HUGE amount. Use SQL or a table as the record source.

>>My another question is that. I need to create a form that involves fields from
>>5 different tables. The parent table has two fields, customer_id which is also
>>a "primary field, and customer_name. Child tables are updated daily when
>>necessary. However, when the user input the data, he/she will not know whether
>>the customer is an existing one or not. But since the customer_id is defined as
>>"primary", there will be an error when inputing an old customer_id. Is there
>>any good way to get around? One way I can think of is to leave the Controlsource
>>empty and check whether the customer_id is already exist. If yes, then check
>>whether the customer_name is matched with the input. If both are true, then
>>pass the data to the corresponding fields when "lost focus". Is it a good way
>>to do it?
>>
>
>I don't understand your question here. Why is the user unable to see if a customer is already in the table?

Are the Customer_ID fields entered by the user? You might consider having the primary key be a surrogate key (entered by the program, not used for any other purpose). If you MUST have a user-entered key, then you will have to check the value of the field before adding the new record. There are many pitfalls to this method, especially if there are many users on the system.

>>My last question is that when a new customer is input, only the fields corresponding
>>to the parent table are active. None of the child tables allow me to input.
>>I try to tackle this problem by "APPNED BLANK" for each child tables whenever
>>a new record is input. However, as I mentioned before, not all the child tables
>>need to be input. If I create a new record for each child tables, I will turn
>>out having a lot of empty records. Any suggestions?
>
>It is difficult to envision what you are trying to do here. If you do not need to make entries into these tables, why do you need to add a blank record to them?

Use text boxes that are not bound to data fields. When the user clicks the SAVE button then you can check which textboxes are filled in and decide which child tables need to have records appended.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform