Help needed

  • Thread starter Mayank Prakash Gupta
  • Start date
M

Mayank Prakash Gupta

hi,
I have a form in access where i choose some table name from a drop down box
and then input the number of records to see from the table. This generates a
new table by a name, say, xxx. now i want this table to automatically open
up and display the results instead of me opening it from the table list.

can anyone help??
 
F

FSt1

hi,
i think you just need to add a line of code, probably the last line of your
code that makes the table.

DoCmd.OpenTable "yourTable", acNormal, acEdit

Lookup the DoDmd object in access help for more explination.

regards

FSt1
 
J

John Vinson

hi,
I have a form in access where i choose some table name from a drop down box
and then input the number of records to see from the table. This generates a
new table by a name, say, xxx. now i want this table to automatically open
up and display the results instead of me opening it from the table list.

can anyone help??

Whoa!

You're creating lots and lots of NEW TABLES, just to display results?

That's going to bloat your database very rapidly; it's going to be
slow, because of the large overhead in creating a new table; it risks
database corruption; and above all, it's probably *not necessary*.

If you want to see selected records from a table - use a Select Query
as the recordsource of a form. No need to move them to another table
at all!

You're making an easy task much more difficult, perhaps based on
experience from other types of databases where creating scratch tables
is routine: it is NOT routine, and it's very rarely necessary, in
Access.

John W. Vinson[MVP]
 
Top