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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Read the value of the control in a Specific Cell in a grid 2

Status
Not open for further replies.

BScullion

Programmer
Aug 25, 2003
7
GB
I have a problem reading the value of a specific column in a grid while scrolling down one of the other columns.

In my situation the grids recordsource is set to table 2 and displays a combobox populated with the fields in table 1.

In the grid, users can enter information about table 1 (for example: field name; field description; task to perform on field; etc...)

I need to display sample data from whichever field they have chosen, but the only time I can successfully access the fields name is when that particular column is selected. So if they move to a different column and scroll down the records, the sample data remains static.

Help!
 
I do not understand your problem perfectly, but think that I can suggest two differnt solutions for the same issue.

1. Make the tables related..
SELECT table1
SET RELATION TO myField INTO table2

This will make the record pointer of other table keep responding to the first one.

2. Create a common cursor and identify yourself.
SELECT table1.*, table2.* FROM table1, table2 ;
INTO myCursor READWRITE ;
WHERE table1.field1 == table2.field1 or whatever...

Now the myCursor can be used to populate the grid.

:-}


ramani :)
(Subramanian.G)
 
Thank you very much for your suggestions.

Im not sure I can relate the two tables, or join them in a query.

The program that I am writing is a data scrutiny utility, and Table2 is a table that holds all its settings. The main data held is:
1) fieldname (as it exists in Table1 which is the main data table to perform these tasks on.)
2) task to perform on that field

So the records in the settings table might look like this:

----------- -------------------- -----------------
Fieldname FieldDesc Task
----------- -------------------- -----------------
empnum Employee ID Find Min/Max
retireage Retirement Age Find All Values
earnings Employee Earnings Find Min/Max

And this is what the user sees in the grid on the form.

Field name is set up as a combobox of fields as they exist in the main data table structure.

So they select a field, and the task to perform on that field. Then when they have entered all the fields and tasks, they can execute the tasks at a later data/time.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top