Welcome! Log In Create A New Profile

Advanced

How do you "select" the record you just created in a table?

Posted by Dan M 
I have a table of companies.

there is a button to create a new company which opens a new window to create the company.

After saving the new company, I want to return to the table but be located on the company record which was just created.

In the button that calls the window to create the new company I have tried ...

TableDisplay(TABLE_QRY_Companies, taCurrentRecord)
TableDisplay(TABLE_QRY_Companies, taCurrentSelection)


The button code is (which call the window to create the new company is ...

Open(WIN_Quick_Create_Company)
TableDisplay(TABLE_QRY_Companies, taCurrentSelection)

How do I know what the current record or selection is?

Do I need to return the current record (the record that was just created) to the table?

If so, how do I do that?


Any help would be greatly appreciated !!

Dan
Hello Dan,

I think that the code you use is correct.
There could be one thing:
In the WIN_Quick_Create_Company there is a 'independent hyperfile context' selection in the detais Tab. This should be of.

Otherwise try a recompiling the project.

Dan,

If I am reading your notes correctly then the company you created will be the last record in the table if you use the primary index key. Therefore you could open the table and do a HreadLast statement using the primary index.

Milton
Hi Dan,

i think it is impossibel to do this with one command.

Open(WIN_Quick_Create_Company)
TableDisplay(TABLE_QRY_Companies, taStart) - get the new record(s) in the table.

Then you can make a automatic search :

HReadSeek(File,BrowsKey,Search) - search can come back from Window
TableDisplay(TABELLE,taCurrentFirst)

I hope also to find a better solution.

Christoph

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: