General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Insert using data from form transact sql
ALTER PROCEDURE dbo.Add_Product
(
@Product_Code char = [Forms]![frm_main]![Product_Code_Text],
@Product_Desc char = [Forms]![frm_main]![Product_Desc_Text],
@Product_Supplier char = [Forms]![frm_main]![Product_Supplier_Combo],
@Product_manufacturer char = [Froms]![frm_main]![Product_Manufacturer_combo],
@Product_Serial char = [Forms]![frm_main]![Product_Serial_Text],
@Product_Cost money = CONVERT(money, [Forms]![frm_main]![Product_Cost_Text])
@Product_Id bigint = 1 + SELECT MAX(Product_ID) FROM dbo.products
)
AS INSERT INTO dbo.Products
(Product_Code, Product_Description, Product_Supplier, Product_Manufacturer, Product_Serial, Product_Cost_Ex_GST, Product_Id)
VALUES (@Product_Code, @Product_Desc, @Product_Supplier, @Product_manufacturer, @Product_Serial , @Product_Cost , @Product_Id)
The error I get when trying to save the proceedure is "ADO error: Line 3: Incorrect syntax near '!'. Line 10: Incorrect syntax near ')'. Must declare the variable 'Product_Code'
Any pointers in the right direction would be great. I am starting to get the feeling I am going to have to do this in VB.