i recieving error on rs.open up to conn on private sub cmdlogin
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String
Dim cmd As ADODB.Command
Dim button As String
Private Sub ConnectToDB()
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & App.Path _
& "\dbHMS.mdb"
conn.Open
End Sub
Private Sub OpenNewRecordSet()
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open sql, conn, adOpenStatic, adCmdText
End Sub
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdlogin_Click()
'here is my error'
rs.Open "select AccountID, UserName, Password from Account where UserName = '" _
& txtuser.Text & "' And Password = '" & txtpass.Text, conn
If Not rs.RecordCount = 0 Then
frmMain.Show
Unload Me
Else
MsgBox "Invalide Input", vbExclamation + vbOKOnly, "Error"
End If
End Sub