trying to find a record in a Recordset,
both with a numeric value, and with a string value.
but ADO wont let me...errors are:VB Code:
Private Sub CboPrice_Click() Dim ConnString As String ConnString = "Provider= Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\ProPsmDb.mdb;" & "Persist Security Info=False" Set CN_Price = New ADODB.Connection CN_Price.ConnectionString = ConnString CN_Price.Open ConnString Set RS_Price = New ADODB.Recordset RS_Price.Open "select * from price", CN_Price, adOpenStatic, adLockOptimistic, adCmdText RS_Price.Find "ptext" = CboPrice.Text ' Ptext is a string value RS_Price.Find "id" = CboPrice.ItemData(CboPrice.ListIndex) ' numeric value txtName.Text = RS_Price!pricename txtPrice.Text = RS_Price!price
1. "Argument are of the wrong type" = search with string value
2. "type mismatch" = serarch with numeric value
why wont it find?? would very much appreciate any help...
tnx in advance 2 any ideas/suggestions.




Reply With Quote