Must delcare the scalar variable

  • Thread starter Thread starter Tom Nowak
  • Start date Start date
T

Tom Nowak

I am running an Update routine that calls a function. It appears that the
function never executes because I receive:

Must Declare The Scalar Variable @Country.

Code:

Dim newCustomer As New Customer
newCustomer.CustomerID = customer.CustomerID
Me.PutCustomerData(newCustomer)
Try
If Not CustomerDB.UpdateVendor(customer, newCustomer) Then
MessageBox.Show("Another user has updated or deleted
that customer.", _
"Database Error")
Me.DialogResult = Windows.Forms.DialogResult.Retry
Else
customer = newCustomer
Me.DialogResult = Windows.Forms.DialogResult.OK
End If
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
End Try

The only time @Country is used is in a Insert function. In the Update
fuction, I use @NewCountry and @OldCountry, so I am not sure why this is
happening.

Please help.
 
Back
Top