Your technology certification is waiting. Enroll in Cloud Class ®
The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
dim username as String
Dim db as Database
dim myMakeQuery as QueryDef
dim OriginalSql as string
'Sets your variable for the make table to your actual make table query
set MyMakeQuery = db.Querydefs("name of make table query")
'sets the variable to your original sql string with using the word customer as a filler for the username coming from the texbox
OriginalSql = "Select * From tblUsers Where tblUsers.User = customer"
'Gets what is in the original sql string after the word customer has been replaced with what was in the variable username.
db.querydefs("Name of your pass through query").SQL = Replace(originalSql, "customer", username)
MyMakeQuery.Execute 'Executes the make table query which creates your UserOrders table.
'Set your pass through query back to the original if necessary...
db.querydefs("Name of your pass through query").SQL = originalSql
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.