I have several tables where I want to add information to for a user interface which does not have the productid. So I want to capture the last productid and (1) to it for the next productid and insert that id info into three tables ( commnets, phase, phasedescription). Here is what i think will do the job for me. I declare a variable to capture the value of the last producti and increase it by 1.
Dim prod
prod = "SELECT(last_productid)+ 1 FROM Product
Then the insert statement for the other tables will be:
Dim strInsert
strInsert = INSERT INTO Comment (prod, nature, comments) VALUES (prod, suggestions, blah blah)
For table Description it will be:
strInsert = INSERT INTO Description(prod, phasename, steps, status) VALUES (prod, phasename, H3, 2).
And so on. However, for some reason it is not working.
Please tell what I should do now.
Thanks
koniba
niarela@aol.com
Dim prod
prod = "SELECT(last_productid)+ 1 FROM Product
Then the insert statement for the other tables will be:
Dim strInsert
strInsert = INSERT INTO Comment (prod, nature, comments) VALUES (prod, suggestions, blah blah)
For table Description it will be:
strInsert = INSERT INTO Description(prod, phasename, steps, status) VALUES (prod, phasename, H3, 2).
And so on. However, for some reason it is not working.
Please tell what I should do now.
Thanks
koniba
niarela@aol.com