Rasheed Shaik
Programmer
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Set fd = CreateObject("Adodb.connection")
fd.Provider = "Microsoft.jet.oledb.4.0"
fd.Open App.Path & "\Users.mdb", "endromida"
'fd.Open "\\mika\medrar\Medrar.mdb","endromida"
Set Fs = New ADODB.recordset
Fs.Open "Select role from Useraccount where username = '" & Text1.Text & "'", fd, adOpenKeyset, adLockOptimistic
While Not Fs.EOF
Text3.Txt = .Fields!role
Fs.MoveNext
Wend
Fs.Close
Set Fs = Nothing
Call cmdOK_Click
End If
End Sub
**********
Invalid Reference of Role
If KeyAscii = 13 Then
Set fd = CreateObject("Adodb.connection")
fd.Provider = "Microsoft.jet.oledb.4.0"
fd.Open App.Path & "\Users.mdb", "endromida"
'fd.Open "\\mika\medrar\Medrar.mdb","endromida"
Set Fs = New ADODB.recordset
Fs.Open "Select role from Useraccount where username = '" & Text1.Text & "'", fd, adOpenKeyset, adLockOptimistic
While Not Fs.EOF
Text3.Txt = .Fields!role
Fs.MoveNext
Wend
Fs.Close
Set Fs = Nothing
Call cmdOK_Click
End If
End Sub
**********
Invalid Reference of Role