Results 1 to 3 of 3

Thread: create table and queries

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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.

  2. #2
    Addicted Member
    Join Date
    Jan 1999
    Posts
    165

    Post

    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 )

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width