Aliases in Update Queries

R

roccogrand

I have the following query:

UPDATE tblMyQuestions SET tblMyQuestions.StudentName =
tblStudentCodes.StudentCode;

When it is run, it says "Enter Parameter Value" and then displays
"tblMyQuestions.StudentName"

I would like to change the first phrase to "Enter your student code" and not
show the table.field value at all. Is this possible?

Thanks.

LDN
 
M

Michel Walsh

Your table myQuestions have a field StudentName ?

if so, something like:


UPDATE myQuestions
SET StudentName = [Enter your student code]


or, maybe


UPDATE myQuestions
SET StudentName= DLookup( "StudentName", "StudentCodes", "StudentCode=" &
[Enter your student code] )



Hoping it may help,
Vanderghast, Access MVP
 
M

Michel Walsh

Forgot to mention that without any WHERE clause, your UPDATE will update ALL
records with the single value you supplied! Probably not what you really
want.



Vanderghast, Access MVP
 
R

roccogrand

Thanks Michel,

This looks like it may work. I will try as soon as I get home tonight.

I do want the field to be completely updated, i.e., flushed of very student
code. I use another table to archive the data at runtime if the user needs
to store his/her data, otherwise the field is overwritten.

Thanks again.

LDN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top