Error message in query??

kabir_hussein

Registered User.
Local time
Today, 09:32
Joined
Oct 17, 2003
Messages
191
hi i am doing the following update query to update prices

UPDATE PartTable SET PartTable.[Selling Price] = (([PartTable]![Mark Up]/100*[PartTable]![Guide Cost])+[PartTable]![Guide Cost])
WHERE (((PartTable.Category)=[Forms]![FrmCategoryEdit]![Sub Category]));


but for some reason when i save it and exit it i get the following message

Im i doing some think wrong

thank you
 

Attachments

  • errormesage.JPG
    errormesage.JPG
    34.7 KB · Views: 136
Since you are referencing the table contained in the query, you can leave off the reference to it in the update calc:

([Mark up] / 100 * [Guide Cost]) + [Guide Cost]

If you need to reference the table explicitly, then you seperate with '.' (dot), not a '!' (bang). So then we would have:

([PartTable].[Mark up] / 100 * [PartTable].[Guide Cost]) + [PartTable].[Guide Cost]

You have to do this in an expression if you have two or more tables in a query where you have the same field names.

Look up Use the ! and . (dot) operators in expressions in Access help for a further discussion on these things. I believe you will see that the way you have it currently makes Access think its looking for an open object named PartTable and it is getting all confused.
 

Users who are viewing this thread

Back
Top Bottom