Hi,
What is wrong with this

VB Code:
  1. Private Sub cmdSearch_Click()
  2. If Trim(txtPs.Text) <> "" Then
  3.   'we have something in the text box
  4.      rs.Open "SELECT * FROM UNPW WHERE unpw Like '" & Trim(txtPs.Text) & "'", cn, adOpenKeyset, adLockBatchOptimistic, adCmdText
  5.    If rs.EOF Then
  6.     'nothing was returned
  7.      txtUn.Text = ("NONE FOUND")
  8.      txtPw.Text = ("NONE FOUND")
  9.    Else
  10.     'We have one or more results
  11.      
  12.      txtUn.Text = rs.Fields("UserName")
  13.      txtPw.Text = rs.Fields("PassWord")
  14.    
  15.   End If
  16. End If
  17. rs.Close
  18. End Sub



I get this error

No value given for one or more required parameters.

This code i working on another program I have, but for some reason it will not work on this one.

Thanks