By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

saving [enter a value] in update query

P: n/a
Hello.

No one in the queries newgroup answered this question. I hope someone here
can. Thank you. Stuart

The following Update Query allows my users to substitute a numerical value
for the phrase "Allele 2" in the field Taqcall. This is run from a command
button on a form for the table:

UPDATE tblSEQTAQ AS A SET A.taqcall = [Enter a Value for Allele 2:]
WHERE (((A.taqcall)="Allele 2"));

I would like to display the value entered to replace "Allele 2" in the
table. That is if the user changes all of the "Allele 2" values to the
number "1," then I want to have the number 1 displayed on the form next to
a caption that reads "Allele 2."

TIA for your help.

Sincerely,

Stuart E. Wugalter
Statistician II
Building: PMB B100
Mail Code: 9011
Department: Zilkha Neurogenetic Institute
Division: Keck School of Medicine
Telephone: (323) 442-1080
FAX: (323) 442-3054
E-Mail: wu******@usc.edu

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
dp
I get around this problem of asking for values twice for parameters in
queries with global variables. Here is what I do: I have module with
public code in it.

global savedVar as string
-----------------------------------------------------------------
public function savedVarReturn() as string
savedVarReturn = savedVar
end sub
-----------------------------------------------------------------

BEFORE you start to run the query, do an

savedVar = inputbox("What is the value of the parameter?")

Now you have the value in "savedVar" which is global, you can reference it
straight from code, or, if you want to retrieve the value for a query
parameter, as the criteria of that field, put the return function in the
criteria... Since it doesn't change, you can use it for a second, and third
query as well.

savedVarReturn()

Remember, you must have filled in savedVar before you call the function from
within the query.

-Brian
"Stuart E. Wugalter" <wu******@usc.edu> wrote in message
news:c1**********@gist.usc.edu...
Hello.

No one in the queries newgroup answered this question. I hope someone here
can. Thank you. Stuart

The following Update Query allows my users to substitute a numerical value
for the phrase "Allele 2" in the field Taqcall. This is run from a command
button on a form for the table:

UPDATE tblSEQTAQ AS A SET A.taqcall = [Enter a Value for Allele 2:]
WHERE (((A.taqcall)="Allele 2"));

I would like to display the value entered to replace "Allele 2" in the
table. That is if the user changes all of the "Allele 2" values to the
number "1," then I want to have the number 1 displayed on the form next to a caption that reads "Allele 2."

TIA for your help.

Sincerely,

Stuart E. Wugalter
Statistician II
Building: PMB B100
Mail Code: 9011
Department: Zilkha Neurogenetic Institute
Division: Keck School of Medicine
Telephone: (323) 442-1080
FAX: (323) 442-3054
E-Mail: wu******@usc.edu

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.