Query Question

  • Thread starter Thread starter ddans
  • Start date Start date
D

ddans

Guest
was wondering why i'm getting an error saying this isn't an updateable query,

PARAMETERS [spSubSystemHours] Text ( 255 ), [UserEntry] Text ( 255 );
UPDATE tblSubSystem SET tblSubSystem.SubSystemHours = (((SELECT tblSubSystem.SubSystemHours FROM tblSubSystem WHERE (tblSubSystem.SubSystemDetails)=[spSubSystemDetails]))+UserEntry)
WHERE (((tblSubSystem.SubSystemDetails)=[spSubSystemDetails]));

I made this query so that I can use it in a vb.net program I have where I want to update subsystemhours by adding a number entered by the user in the program. I'm not even sure you can write a query like this in access. I'm thinking I might have to write 2 different queries, 1 that selects, and 1 that updates instead of trying to combine them. I was just wondering if writing a query like this is possible. If anyone sees what I've done wrong, please help. Thanks alot.
 
How 'bout

Code:
PARAMETERS [spSubSystemHours] Text ( 255 ), [UserEntry] Text ( 255 );
UPDATE tblSubSystem 
SET tblSubSystem.SubSystemHours = [spSubSystemDetails]&UserEntry
WHERE tblSubSystem.SubSystemDetails=[spSubSystemDetails];

RV
 
That gave me an error, but I believe its because I don't have a UserEntry field in my table. Should I add one so that I can use an Update stored procedure for my vb.net program to add numbers to the User Entry in the database, and then use an Update Query to add the User Entry with what is already in the subsytem hours field all in the database?
 

Users who are viewing this thread

Back
Top Bottom