Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List/Forms

Status
Not open for further replies.

Jimgarry

MIS
May 16, 2000
112
I have a list I have put in a form. the user select an itme from the list it then launches another form. but instead of populating the the form with the data from the selection it goes back to the first record in the data base and populates it with that data. What am I forgetting to do on this? thanks for help in advance
 
In Type i have (6) fields and in source i have one of the filed names
 
Hi!

List does not automatically handles record moving in the source when user selects an item in list. List just populate self by the content of the cursor/table and shows it. When contant changed, for example, list does not reflect change until you use requery method of the list.

In your case befor opening the form you need to set record pointer in the cursor manually. If cursor you used don't have deleted records, you can use ListIndex proeprty of the list box as a record numeber. However, it is much better to use MyListBox.List[MyListBox.ListIndex,ColumnNumber] value to get a value of some key field and locate the record in cursor by that value. You can hide key field values in the list by specifying ColumnWidth property of list box, for example, when you use 7 fields and last of them is a key field, you can hide key field by setting something like following in the ColumnWidth:
'100,30,50,100,20,60,0'
Note that ColumnCound should be specified corrcetly to make ColumnWidth work.

Good luck!

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top