How to Show Form ComboBox value into other Form Label caption

  • Thread starter Thread starter K
  • Start date Start date
K

K

Hi all, I got two forms in database. 1st form name is "F_Login" and
2nd form name is "F_Main". How can I put "F_Login" ComboBox value
into "F_Main" Label. I tried below code but I am getting error.
Please can any friend help me on this.


On form "F_Main" Load event I put below code
Me.Label28.Caption = "Current User: " & Form![F_Login].Combo0.Value
 
Hello K.
K said:
Hi all, I got two forms in database. 1st form name is "F_Login" and
2nd form name is "F_Main". How can I put "F_Login" ComboBox value
into "F_Main" Label. I tried below code but I am getting error.
Please can any friend help me on this.


On form "F_Main" Load event I put below code
Me.Label28.Caption = "Current User: " & Form![F_Login].Combo0.Value

The name of the collection with the open form is named "Forms", not
"Form". So try this:
Me.Label28.Caption = "Current User: " & Forms![F_Login].Combo0.Value

In general, when asking for help, also tell us the error message.
 
put this in the button click event in form1

F_login flogin = new F_login(comboBox1.Text);
this.Hide(); // to hide the login form and display main form
flogin.ShowDialog(this);


put this in the second form contructor

public F_main( string combo)
{
InitializeComponent();

label1.Text = combo;
}




now label1 will display the combo box value.....

all the best
Hi all, I got two forms in database. 1st form name is "F_Login" and
2nd form name is "F_Main". How can I put "F_Login" ComboBox value
into "F_Main" Label. I tried below code but I am getting error.
Please can any friend help me on this.


On form "F_Main" Load event I put below code
Me.Label28.Caption = "Current User: " & Form![F_Login].Combo0.Value
On Thursday, May 20, 2010 6:39 AM Wolfgang Kais wrote:
Hello K.
:

The name of the collection with the open form is named "Forms", not
"Form". So try this:
Me.Label28.Caption = "Current User: " & Forms![F_Login].Combo0.Value

In general, when asking for help, also tell us the error message.
Submitted via EggHeadCafe - Software Developer Portal of Choice
Silverlight Binary Serialization and Compression with WCF Services
http://www.eggheadcafe.com/tutorial...zation-and-compression-with-wcf-services.aspx
 
Since this is an forum for Access, and Access uses VBA, why would you post
sample code in what appears to be C?

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: "Access 2010 Solutions", published by Wiley
(no e-mails, please!)



vincent vinod said:
put this in the button click event in form1

F_login flogin = new F_login(comboBox1.Text);
this.Hide(); // to hide the login form and display main form
flogin.ShowDialog(this);


put this in the second form contructor

public F_main( string combo)
{
InitializeComponent();

label1.Text = combo;
}




now label1 will display the combo box value.....

all the best
Hi all, I got two forms in database. 1st form name is "F_Login" and
2nd form name is "F_Main". How can I put "F_Login" ComboBox value
into "F_Main" Label. I tried below code but I am getting error.
Please can any friend help me on this.


On form "F_Main" Load event I put below code
Me.Label28.Caption = "Current User: " & Form![F_Login].Combo0.Value
On Thursday, May 20, 2010 6:39 AM Wolfgang Kais wrote:
Hello K.
:

The name of the collection with the open form is named "Forms", not
"Form". So try this:
Me.Label28.Caption = "Current User: " & Forms![F_Login].Combo0.Value

In general, when asking for help, also tell us the error message.
Submitted via EggHeadCafe - Software Developer Portal of Choice
Silverlight Binary Serialization and Compression with WCF Services
http://www.eggheadcafe.com/tutorial...zation-and-compression-with-wcf-services.aspx
 
Back
Top