PDA

Click to See Complete Forum and Search --> : create table and queries


Spawny
Jul 6th, 1999, 04:31 PM
Hi i have a database that creates 2 things when a new user is introduced to the database. First it takes all of there info and stores it in a main table and secondly it creates a new table under there name. now my question is ... Is there a way of querying the newly created table. I have this code for a different table with the same fields but need to use it to query the new table... is there a wild card to qyerying

SELECT * FROM Results ORDER BY Date;

I know this is basic but i am a newbie and need assistance. Any ideas? Thanx in advance.

J Staniforth
Jul 6th, 1999, 06:40 PM
I'm not sure that creating new tables every time a new person is entered is a good idea.
But assuming that you have good reason..
Try;

Dim VarHoldingNameOfTable String

VarHoldingNameOfTable = "UserNameTBL" <- 'whatever you called it

SQLstr = "SELECT * FROM " _
& VarHoldingNameOfTable

set RS = DB.OpenRecordSet( SQLStr )

Spawny
Jul 7th, 1999, 08:39 AM
Thanks J Staniforth for your help but I have a question. The SQL statement I had is in MS Access. Can I use this code in the Query part?