Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird List Box
Message
From
18/11/2000 09:52:55
 
 
To
17/11/2000 12:21:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00443091
Message ID:
00443361
Views:
11
Hi Steven.

>> I have two listboxes on a form. The first has a list of department numbers. When I click on a particular department number the second list box is then populated with employee ID numbers that are in the department selected. <<

OK. This seems relatively straight forawrd. The RowSource of the Employee list box is dependent on the selection in the Department list box. Pretty simple stuff < s >. I assume that you are using a RowSourceType = 3-SQL in your employee list box and the RowSource is something like "SELECT Employee.Name, Employee.number.... FROM Employee WHERE Employee.Department = Department.Department INTO CURSOR csrEmp". This assumes that the department list box has a RowSourceType = 6-Fields and its RowSource is something like "Department.Name, Department". If the department list box is a dropdown list (as opposed to a scrolling list), you can refresh the contents of the dependent list by issuing a "This.Parent.LstEmployee.Requery()" in the combo's Valid. The combo's valid fires whenever the user selects an item in the combo. Unfortunately, this is not true for a scrolling list. Here, the valid only fires right before the list loses focus.

>> The second list box does not have a click event, it has a doubleclick event <<

< lol > Actually, all list boxes have both events. I take it that you mean that you only have custom code in the dblClick method of the control.

>> Now when I go to the second listbox and select an ID it changes to the ID number I selected in the prior employee number listbox. I have noticed when this listbox loses focus the number that was changed reverts back to the proper number. Also eventhough the number appears wrong, the doubleclick and right click events work on the proper ID number and not the displayed ID number. And if I go back and select the department number a second time the transformation problem goes away. <<

Sounds like a Refresh issue to me.

>> Any Suggestions? <<

Try steppong throught he code in the debugger to see what is going on. It is a little difficult to come up with an exact solution when you have not posted any code.

HTH

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform