Tutorial: FoxPro D - Database Combo
Controls For Indexes

Dr. Thomas E. Hicks
Computer Science Department
Trinity University
 


1] Open the form with the form Designer. Add the prompt [Order By] for the control.  Using the mouse, select the combo control. See Below!

For discussion purposes, I will assume that you have already created quality indexes called CompanyNam, ContactNam, and CustomerID

2] Using the mouse, touch the vicinity of the form where you would like to place the new control. See Below!

3] Using the mouse, right mouse click on the new control and select Builder. See Below

4] The data for the control may be stored in an internal code array, in a table, or entered by hand. Select Data Entered By Hand! See Below!

6] Fill out the text options that are to be visible to the user. I shall use

  1. Company Name
  2. Contact Name
  3. CompanyID

When finished, select the Value Tab. See Below!

7] Select a numeric variable with which to associate the combo box. I shall use IndexNo. See Below!

7] Select the valid event. When this combo box is selected, the designated procedure code will be executed. I choose to call a procedure called SetIndex to be stored in procedure Code.PRG   See Below!

8]  Make the control variable global. Initialize it to one of the values. Setting IndexNo to 1 will make Company Name appear in the control when the form is launched. It will also be necessary to Set Order To CompanyNam. See Below!

9] The code for ProcessIndex is listed below.

 


May be accessed through URL: http://www.cs.trinity.edu/~thicks
May also be accessed through URL: http://carme.cs.trinity.edu
This Document May Not Be Printed or Reproduced Without Written Permission.
 2003 Copyright : Dr. Thomas E. Hicks
Permission granted : Professional Educators & College Students may print one copy of this page!

Dr. Thomas E. Hicks

Computer Science Department    
Trinity University

"Dr. Web"