In my VB6 project i have created company registeration form, login form and the main form(which deals with other activites for the project). Now registeration form and login form are working well and good but i am not able to display the company name in the main form which the user had enterd while registeration.
Tries:
Basically what i want is whenever i login to the account using the login details i want to display my company's name in the main form (label1.caption) which i had enterd while registering.
You could simply refer to your login form in you main form's code. If your login form is called frmLogin
for example and has a lblCompany
label, you can access the label from the main form using:
frmLogin.lblCompany.Caption
There are better ways to do this though:
in frmLogin:
Public Property Get Company() As String
Company = lblCompany.Caption
End Property
in frmMain:
Public Sub DisplayLogin()
Dim frm As New frmLogin
frm.Show vbModal
MsgBox frm.Company
End Sub