Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default pass value from combobox on form1 to a label.caption

Hi all,

I want to pass the value that is chosen in a combobox (serving as a lookup) to a second form and put it in a label caption.

I have publicly declared (public order as string) the chosen value, but when i activate the second form the variable seems to change to 'nothing'.

Anybody got any ideas how to solve this?

Thanks in advance.

Sybolt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default pass value from combobox on form1 to a label.caption

Hi all,

I want to pass the value that is chosen in a combobox (serving as a
lookup) to a second form and put it in a label caption.

I have publicly declared (public order as string) the chosen value,
but when i activate the second form the variable seems to change to
'nothing'.

Anybody got any ideas how to solve this?

Thanks in advance.

Sybolt


You need to make your public variable 'global' in scope so it can be
accessed anywhere in your project. I use a standard module named
'm_OpenClose' where I put all startup/shutdown code and declare/define
all global variables/constants/declares.

In this startup module...

Public gsOrder As String

...and in your 1st form...

gsOrder = ComboBox1.Text

...so it's available thereafter to your 2nd form.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
label caption JT Excel Programming 1 February 4th 08 06:53 PM
label caption gramps Excel Discussion (Misc queries) 0 November 1st 07 03:56 PM
Pass highlighted list variable to caption ExcelMonkey Excel Programming 1 March 29th 07 08:52 PM
label caption Rod Taylor Excel Programming 2 July 31st 03 03:25 AM


All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"