Hi,
Inside my main form, I have a sub form which displays a table. I have a command button called "Create table" which is linked to a macro which is meant to build up the contents of the table.
The macro contains a series of runSQL statements which simply insert records into the table. I have also set "ShowWarnings" to No so that the SQL insert confirmation dialogs do not appear.
The initial problem I had was that after i executed the macro, then the contents of the sub form table would still be blank. So I added the action "ShowAllRecords" to the end of the macro which should refresh the table and display the new contents.
That worked fine but only if i clicked on the command button twice. And another problem was that the "ShowAll Records" action seems to make the form jump back to the first record in the database. But i don't want it to jump to any other records, I just want it to stay on the current record.
Is there any way of setting it to display the table contents via only one click of the macro button, and also making it stay in the current record?
And can anyone explain why I have to click on the macro button twice (which effectively executes the list of runSQL statements twice) just for the table to be displayed?
I would prefer methods which don't involve any VB.
Also, does anyone know what argument name to use if you want to refer to the current record number in a form? ie [Forms]![????]
As i want to build an expression which involves the record number.
Your help will be most appreciated,
Raymond
Inside my main form, I have a sub form which displays a table. I have a command button called "Create table" which is linked to a macro which is meant to build up the contents of the table.
The macro contains a series of runSQL statements which simply insert records into the table. I have also set "ShowWarnings" to No so that the SQL insert confirmation dialogs do not appear.
The initial problem I had was that after i executed the macro, then the contents of the sub form table would still be blank. So I added the action "ShowAllRecords" to the end of the macro which should refresh the table and display the new contents.
That worked fine but only if i clicked on the command button twice. And another problem was that the "ShowAll Records" action seems to make the form jump back to the first record in the database. But i don't want it to jump to any other records, I just want it to stay on the current record.
Is there any way of setting it to display the table contents via only one click of the macro button, and also making it stay in the current record?
And can anyone explain why I have to click on the macro button twice (which effectively executes the list of runSQL statements twice) just for the table to be displayed?
I would prefer methods which don't involve any VB.
Also, does anyone know what argument name to use if you want to refer to the current record number in a form? ie [Forms]![????]
As i want to build an expression which involves the record number.
Your help will be most appreciated,
Raymond