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

Creating sub form table with macros

Status
Not open for further replies.

Reimondo

Technical User
Feb 26, 2003
26
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top