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!

Losing record pointer in Listbox 1

Status
Not open for further replies.

SuperBob

Technical User
Sep 18, 2001
23
GB
Problem that I am finding difficult to solve.

I have a database of two tables (I'll call them Table1 and Table2), the tables being linked by a common key, providing a one-to-many relationship to Table2. I have a form where I've defined in the data session that the records in Table2 are filtered by the index key value that relates the records back to Table2. The tables are displayed in listboxes.

I can click through Table1, and corresponding Table2 records appear fine in their listbox. When I select a record from Table2, I display the fields in text boxes, and all looks fine there too.

The problem comes where I open a memo field in Table2, make a change (or not - it doesn't matter) and return to the form. The record pointer in Table2 has moved back to the first record that matches the cxurrent Table1 record. The same thing happens when I Alt-Tab to another screen, i.e. the Debugger and back to my form, the pointer in Table2 moves always back to the first record matching the current Table1 record.

Obviously, I want to retain my position in Table2, but can't work out how to do this. Anyone know what's going on?
 
do you have any code in the form's other event properties like GotFocus or Activate events? i had exeprienced this also and removing commands like "go top" or "go 1" from such form's event properties solved the problem.

lemme know if this helped.

torturedmind [trooper]
 
I certainly have used Activate/GotFocus while trying to sort out the problem, but removed all code again - the form itself just has Init and Load methods used. It certainly looks like something is happening when the form loses focus and then regains it..
 
More info - I've recreated the form in ordre to start wiht a clean slate, and just added the listboxes, and the Data Environment of linked tables. I can Alt-Tab to another app. and bcak again, without a problem. The problem occurs when I double-click on a memo field in one of the Table2 listbox records. When I close down the edit window for the memo field, the pointer in Table2 moves back to the first record for the parent key...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top