Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update field Issue 1

Status
Not open for further replies.

Cpreston

MIS
Joined
Mar 4, 2015
Messages
987
Location
GB
Hi

I have linked a product table into Access 2016. I want to be able to update a field called Amount by Product Code.

I created an Update query, using the linked product table, which prompts for the code and then prompts for the Amount. I then get it is updating 0 records which it should be updating 1 of course.

What I want it to do is update the Amount field based on the Product Code. The SQL code behind the query looks like the below. Any ideas what I am doing wrong, Thanks

SQL:
UPDATE dbo_Product SET dbo_Product.Thickness = [dbo_Product].[Thickness]
WHERE (((dbo_Product.ProductCode)=[Enter Product Code]) AND ((dbo_Product.Thickness)=[Enter Thickness]));
 
Try something like:

Code:
UPDATE dbo_Product 
SET dbo_Product.Thickness = [Enter Thickness]
WHERE dbo_Product.ProductCode = [Enter Product Code];


---- Andy

There is a great need for a sarcasm font.
 
Perfect worked straight away, many thanks
 
prompts for the code and then prompts for the Amount" or for the Thickness?
In any case, do you have any validation of what user enters?
I would assume the Thickness is a numerical value. so what happens if the user types ABCXYZ as Thickness?


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top