hello. my problem is, after login username and password in one form, then a new form will be appear. how to create coding to insert username in a label at new form after login. i have tried this coding but still not appear. please help me. thanks.....
Public Sub loadInfo()
On Error Resume Next
checkConnection
strSql = "SELECT Username FROM Customer WHERE Psswd='" & strPsswd & "'"
rec1.Open strSql, con, adOpenStatic
lblUsername.Caption = rec1!Username
use this approach in ur coding :-
1. add a standard module in ur project from project->add module
2. in the module declare a public variable to store the username.the sysntax is :-
Public strUsername as String
3. then in the login form whenver you enter the username and password and hit the login button just pass the username to the above variable. the syntax is :-
strUsername=<your username>
4. after this you can access the value you just have passed to this variable from each and every form of your project. like in form2' label :-
LblUsrname.Caption=strUsername
Note : a public variable has a wide range than the usual standard variables which we declare using the 'Dim' keyword. Public variables are always declared by the 'Public' keyword and it has the effect to the entire project.
hope it will solve out ur probs.
regards
Shouvik