Hello
I am working with VB6, which I have linked to an Acces db. I used a Data button to link to 'tblmain' in the Acces db. On the VB form, I can view records from this table (next, previous), but I am trying to find a way to find a record on one form using an unbound text box and a command button. I want the user to be able to type a part number in the unbound text box (Text0), then click the command button to search for the matching record. I have this so far:
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From tblmain Where Text1='" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic
I am getting an error:
'No value given for one or more required parameters'
Any idea what the problem could be? Any thoughts on this would be extremely helpful and appreciated.
Thanks
Jeremy
I am working with VB6, which I have linked to an Acces db. I used a Data button to link to 'tblmain' in the Acces db. On the VB form, I can view records from this table (next, previous), but I am trying to find a way to find a record on one form using an unbound text box and a command button. I want the user to be able to type a part number in the unbound text box (Text0), then click the command button to search for the matching record. I have this so far:
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From tblmain Where Text1='" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic
I am getting an error:
'No value given for one or more required parameters'
Any idea what the problem could be? Any thoughts on this would be extremely helpful and appreciated.
Thanks
Jeremy