General information
Category:
Forms & Form designer
Title:
Grids, textboxes and table relationships
My form opens two tables in it's load method: persons and countrys. Every person record has a birth country code. The countrys table has a country code field and a description.
In the load method I also set a relationship from birth country code in the persons table into country code of the country table. (All the indexes are set).
I've placed a textbox on the top of the form that is tied to country.description. I also placed a grid on the form and tied each of the columns to a field in the persons table. The grid's control source is the persons table.
In the grid's AfterRowColChange method, I added thisform.refresh. The desired result is that the country description for that person's place of birth will be displayed in the text box above the grid.
However, I found that the only way I could get the textbox to display the proper data as I moved within the grid was to add "go recno()" in the refresh method of the textbox.
If a relationship is set up from persons into country and the grid moves the record pointer in persons and the textbox is tied to a field in country, why won't the textbox refresh with a "thisform.refresh"? Why does it take the extra "go recno()" to get it to display properly?
Thanks for your help!
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