Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 8 Jahren, 5 Monaten
Letzter Beitrag:
vor 8 Jahren, 5 Monaten
Beteiligte Autoren:
christoph, Milton, Frans, Dan M

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

Startbeitrag von Dan M am 03.07.2009 13:37

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

Antworten:

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.



von Frans - am 03.07.2009 19:50
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

von Milton - am 03.07.2009 21:51
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



von christoph - am 04.07.2009 11:51
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.