I want to search a name in my table, and if the name is found it should display it.
I have done following:
--------------------------------------
Private Sub cmdSearch_Click()
1 Dim rst as ADODB.Recordset
2 Dim strQuery as String
3 Dim newUname as String
4 Set rst = New ADODB.Recordset
5 newUname = InputBox ("Enter New Username","New"
6 strQuery = "Select username from rpm_users where _
7 username = '" & newUname & "'"
8 rst = cn.Execute (strQuery)
9 If rst!username = newUname Then
10 MsgBox "User Already exists"
11 Endif
End Sub
----------------------------------------
But it is not doing the job. It displays some error at line 9.
Please suggest how to retrieve the searched username.
Thanks.
There is always a new solution for the same problem.
Anonymous
I have done following:
--------------------------------------
Private Sub cmdSearch_Click()
1 Dim rst as ADODB.Recordset
2 Dim strQuery as String
3 Dim newUname as String
4 Set rst = New ADODB.Recordset
5 newUname = InputBox ("Enter New Username","New"
6 strQuery = "Select username from rpm_users where _
7 username = '" & newUname & "'"
8 rst = cn.Execute (strQuery)
9 If rst!username = newUname Then
10 MsgBox "User Already exists"
11 Endif
End Sub
----------------------------------------
But it is not doing the job. It displays some error at line 9.
Please suggest how to retrieve the searched username.
Thanks.
There is always a new solution for the same problem.
Anonymous