General information
Title:
Tabbing from Listbox / Clicking to Grid hangs machine
Problem: Tabbing from ListBox to Grid hangs machine: Seems to fire the
ListBox.Click() event.
The problem form has a listbox and a grid. The rowsource of the listbox
is an array of names. The recordsource for the grid is a cursor named
DispPay, RecordSourceType is "Alias".
The click method of the listbox rebuilds DispPay's index so that only
records for the name currently selected in the listbox are displayed in
the grid. This code also refreshes the grid.
Everything works fine if I click IN the listbox or scroll through it
using the arrow keys. The listbox.click() method fires, the index on
DispPay is rebuilt and the grid is refreshed.
If I either a) click on the grid, or b) TAB to the grid, listbox.click()
seems to fire, although the Trace window in the debugger indicates that
NO code is executing. The event tracking output does not show
listbox.Click() firing.
Here is the listbox.click() code
* set index of DispPay to match selection
* works better and faster than filtering
thisform.ResetDispPay( this.value )
Here is the form method called ...
frmEdit1.ResetDispPay()
*!* Creates index to filter DispPay so that only
*!* the technician chosen from lstTechnicians
*!* will display in grdHours.
*!* The parameter lcWhichTech contains
*!* the new key value.
parameter lcWhichTech
select DispPay
lcOldSafety = set( 'safety' )
set safety off
index on cTechCode tag cTechCode for cTechCode = lcWhichTech
set order to cTechCode
set safety &lcOldSafety
go top
thisform.grdHours.Refresh()
The error is "Variable lcWhichTech is not found". and this is not a
"Cancel / Suspend / Help" message, rather it is "OK / Help".
If I click on OK the status bar shows the record pointer looping around
records 27 and 28.
The message does not go away -- it reappears as soon as OK is clicked.
The debugger does not show that any code is executing, but the variable
displayed is found only in the ResetDispPay method.
The debugger is accessible by an ALT-TAB, but none of its windows can be
made active, nor can its menu be reached. The debugger is running in a
window that is smaller than the VFP window - clicking on the VFP window
does not reactivate VFP, only ALT-TAB gets you back.
I have also tried this with the ResetDispPay code in the ListBox.Click()
event - similar error, (although no parameter had to be passed). If I
used "this.value" as the condition instead of "lcWhichTech" the message
displayed said "THIS can only be used within a method". So then I
changed the code to
lcWhichTech = this.value
index on .... = lcWhichTech
and received the "Variable lcWhichTech is not found" error mentioned
previously.
Then I made lcTechChosen a property of the form, and changed the code to
thisform.lcTechChosen = this.value
index on ... = thisform.lcTechChosen
and the message read "THISFORM can only be used within a method."
This is VFP 5.0, running on Windows NT 4.0, Service Pack 3, Build 1381.
The only way to get out of this is to shut down down VFP using the Task
Manager.
I know this has been long, but any suggestions would be welcome.
Yours truly - MilesThompson
mthompso@fox.nstn.ca
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only