Hi,
I need to insert a new record with a decimal value into a table after a record is created. When my event code runs, I get an error message that says "The precision is invalid." I am using an Access 2000 ADP project front-end to connect to my SQL Server 2000 back-end. The Priority field is defined as decimal with a precision of 9 and a scale of 2. As an example, the Priority field in the form has a value of 2.25.
Any help would be greatly appreciated,
ddub
Here's the code in my form.
Here's the stored procedure.
I need to insert a new record with a decimal value into a table after a record is created. When my event code runs, I get an error message that says "The precision is invalid." I am using an Access 2000 ADP project front-end to connect to my SQL Server 2000 back-end. The Priority field is defined as decimal with a precision of 9 and a scale of 2. As an example, the Priority field in the form has a value of 2.25.
Any help would be greatly appreciated,
ddub
Here's the code in my form.
Code:
Private Sub Form_AfterInsert()
Dim cmd1 As ADODB.Command
Dim prm1 As ADODB.Parameter
Set cmd1 = New ADODB.Command
With cmd1
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "spCreateCIPShellRec"
End With
Set prm1 = cmd1.CreateParameter("@Priority", adDecimal, adParamInput)
cmd1.Parameters.Append prm10
prm10.Value = Me.Priority
cmd1.Execute
End Sub
Here's the stored procedure.
Code:
Alter Procedure spCreateCIPShellRec
@Priority decimal
As
INSERT INTO tblCIPAdj (Priority) VALUES (@Priority)
return