Update query not working

G

Guest

I have an update query that's not updating correctly. I want to find a value
in the Temp table by asking the user for input then change that value based
on more input from the user. This is how my query is set up....
Field: TypeID TypeID
Table: Temp Temp
Update To: [TypeID] Like [Enter New
TypeID]
Criteria: Like [Enter Old TypeID]
or:

The Like [Enter Old TypeID] works to pull up the correct records. The
[TypeID] Like [Enter New TypeID] does prompt the user to enter a value but
the values in the table are updated to a zero value. Please help.
 
M

[MVP] S.Clark

I've never tried an Update Query with two parameters, but in theory it
should work. Just combine what you have into one column, instead of two,
and it might work.
 
G

Guest

Hi, Lorraine.

One may be vague in the selection criteria, but one should not be vague in
the value that will be assigned to the column in the update query. Instead
of using LIKE in the "Update To:" cell, set it to the value that the user
types in. For example, try:

Field: TypeID
Table: Temp
Update To: [Enter New TypeID]
Criteria: Like "*" & [Enter Old TypeID] & "*"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
G

Guest

Come on now, do you really think that makes a difference? Not at all!
--
Lorraine


[MVP] S.Clark said:
I've never tried an Update Query with two parameters, but in theory it
should work. Just combine what you have into one column, instead of two,
and it might work.


--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting

Lorraine said:
I have an update query that's not updating correctly. I want to find a
value
in the Temp table by asking the user for input then change that value
based
on more input from the user. This is how my query is set up....
Field: TypeID TypeID
Table: Temp Temp
Update To: [TypeID] Like [Enter New
TypeID]
Criteria: Like [Enter Old TypeID]
or:

The Like [Enter Old TypeID] works to pull up the correct records. The
[TypeID] Like [Enter New TypeID] does prompt the user to enter a value but
the values in the table are updated to a zero value. Please help.
 
G

Guest

Exellent advise. Works like a charm.
--
Lorraine


'69 Camaro said:
Hi, Lorraine.

One may be vague in the selection criteria, but one should not be vague in
the value that will be assigned to the column in the update query. Instead
of using LIKE in the "Update To:" cell, set it to the value that the user
types in. For example, try:

Field: TypeID
Table: Temp
Update To: [Enter New TypeID]
Criteria: Like "*" & [Enter Old TypeID] & "*"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Lorraine said:
I have an update query that's not updating correctly. I want to find a value
in the Temp table by asking the user for input then change that value based
on more input from the user. This is how my query is set up....
Field: TypeID TypeID
Table: Temp Temp
Update To: [TypeID] Like [Enter New
TypeID]
Criteria: Like [Enter Old TypeID]
or:

The Like [Enter Old TypeID] works to pull up the correct records. The
[TypeID] Like [Enter New TypeID] does prompt the user to enter a value but
the values in the table are updated to a zero value. Please help.
 
J

John Spencer

I have an update query that's not updating correctly. I want to find a
value
in the Temp table by asking the user for input then change that value based
on more input from the user. This is how my query is set up....
Field: TypeID TypeID
Table: Temp Temp
Update To: [Enter New TypeID]
Criteria: Like [Enter Old TypeID]

Your method was returning True or False (and probably in most cases - false)
False is Zero. Since the Update you constructed was comparing the TypeID
(which should match your criteria) to the NEW value you wanted to replace
the old value with.
 

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