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

SQL Grid Record control 1

Status
Not open for further replies.

Shane1961

Programmer
Oct 1, 2015
14
0
0
AU
I have a SQL Grid in a form.

The initial SQL is in Form.Load (no problem)

But when I click on a record, then display record in a Container (Table Fields)
it stays at bof(), not the selected record.

Thanks in advance.
 
I assume you have a grid with a recordsourcetype 5 - sql statement?
Then the grid displays the query result, not the table, so picking a row in the grid does not change the record pointer position in the table, yes.
You'll have to position there in the Grids AfterRowColChange event via the primary key, for example, or set a RELATION from the grids alias to the table.

Bye, Olaf.



 
By the way, this recordsourcetype is rather avoided by me and I think by most of us here, you can do a query in code instead of sepcifying it as property value and that gives you much more flexibility and context, eg using variables in scope for paramterization.

Then you can bind the grid to the result of that code query. Running in the context and scope of the form itself and all its objects is more helpful than any other approach in my opinion, also in conjunction with subclassing forms or parts of it like data access classes. You can of cause also create a class hierarchy of grids but you can only override the query property in a subclass.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top