How to pass Parameter from VB to Access 2007 Query?

  • Thread starter Thread starter sorokateam
  • Start date Start date
S

sorokateam

Guest
When I run this query I receive the following: "No value given for one or more required parameters"

VB Code to pass parameter to Query
Private Sub BTN_Closed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_Closed.Click
Dim command As New OleDb.OleDbCommand
command.Parameters.AddWithValue("@Value", "2013")
xsql = 3
Try
Me.TA.Closed(Me.DS.TR)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub



TRTableadapter Query

SELECT C_SharePrice, CurrentPosition_Profit, CurrentStock_Value, ID, Owner_ID, P_Commission, P_Date, P_SharePrice, P_Value, Pending, Position_CashMargin, Profit,
Purchase_Shares, S_Commission, S_Date, S_SharePrice, Stock_ID, Stock_Name, TYE, T_Commission
FROM TR
WHERE (Pending = C) AND (TYE = @value)
ORDER BY Owner_ID, Stock_ID


Charlie Soroka

Continue reading...
 
Back
Top