Promt for table name

coryt

Registered User.
Local time
Yesterday, 19:20
Joined
Jun 13, 2003
Messages
82
I created a form that allows the user to add information to the appriopriate tables. Long story short, I want to create a command button that runs a make table query, however, I need it to make a different table with a different name everytime it is pushed. The questions are:

1- Is there a way to have a prompt pop up (when the command button is pushed) asking the user to give the new table a name and have the make table query name the new table whatever the user typed in.

2- Is there a way to have the make table query name the table based on a text box on the form.

Thanks in advance to anyone whom replies.

Cory
 
Sorry, I am kinda new. Can you spell it out for me?
I have information coming from multiple tables, combining into 1 table. Also with the make table query, I had to relate the tables so the info from each table would correspond. How would I do that in sql? Here is an example of what I have so far.

DTable = InputBox("Please enter a name for the table", "Name Table")

mysql = "SELECT tblBox.Contract as ContractNumber, tblContractInfo.ContractName as ContractName" & _
"tblBox.BoxNumber as BoxNumber, tblBox.Description as Description, tblLithoCode.LithoCodes as LithoCodes" & _
"tblStudentInfo.StudentName as StudentName, tblStudentInfo.Grade as Grade" & _
"INTO " & DTable & " IN '\\pease1\groups\shipping\received\altreceived.mdb' FROM tblContractInfo RIGHT JOIN" & _
"(tblBox LEFT JOIN (tblStudentInfo RIGHT JOIN tblLithoCodes ON tblStudentInfo.LithoCode = tblLithoCodes.LithoCode)" & _
"ON tblBox.BoxNumber = tblLithoCodes.BoxNumber) ON tblContractInfo.ContractNumber = tblBox.Contract;;"""

DoCmd.RunSQL , mysql
 
Got it!!!!! THanks
 

Users who are viewing this thread

Back
Top Bottom