How to Show Form ComboBox value into other Form Label caption

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
 
W

Wolfgang Kais

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.
 
V

vincent vinod

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
 
D

Douglas J. Steele

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top