Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird behavior when grid has focus.
Message
From
12/11/1999 13:57:22
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00290652
Message ID:
00290684
Views:
12
>I have a grid bound to a table. If I call a form or procedure from the grid I have a problem with the Selected table staying selected. For example, in the load event of the form I have "Select myTable", but by the time it gets to init, the alias is back to the grid bound table! If I step through the code in the debugger, the alias doesn't change. There are no timers running to change the alias either. The way around this is to SET FOCUS to an object off the grid and then run the form or procedure. If I move the code to the click of a command button, here is what has to be done for it to work:
>
>Thisform.cmdButton.Setfocus
>Thisform.cmdButton.Click
>
>Without the setfocus, the alias changes back to the grid bound table. Any ideas what is causing this?

Grids select the alias of their recordSource while they have focus, and reset the alias when they lose focus. This is so column controlsources can have generic references: "MyField" instead of "Mytable.MyField".

A little tricky to deal with sometimes, but this is how it works.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform