Combo Box Value into a Label (1 Viewer)

smirnoff

Registered User.
Local time
Today, 14:56
Joined
Apr 8, 2005
Messages
13
I have a combo box called cboWeightCheck and would like the selected value to be put into the middle of a string for a Label called lblProd.

Whenever I think im close to figuring it out and I run the report Access crashes on me.

thanks
-Ryan
 

DanG

Registered User.
Local time
Today, 14:56
Joined
Nov 4, 2004
Messages
477
Have had much help here and want to try to give back...so my guess would be..In the field properties>control sours>build> do the following...
"Whatever text you want here " & [field name].
Note the space after the "want here "
I hope this is what you are looking for. :)
 

WayneRyan

AWF VIP
Local time
Today, 22:56
Joined
Nov 19, 2002
Messages
7,122
Ryan,

You can use the report's OnLoad event:

Me.lblProd.Caption = Forms![YourMainForm]![cboWeightCheck]

You have to use the Forms! reference, because the combo box is not
on your form. Assuming that your form's name is "YourMainForm" and
that the form is open when the report is run.

Wayne
 

BryanT

Registered User.
Local time
Tomorrow, 09:56
Joined
Mar 8, 2005
Messages
25
Hello smirnoff

The value from the combo box should be able to be concatenated into a string directly to the label or by doing the concatenation into a string variable first and then displaying it.

Me.lblProd.Caption="First Part of string " & Me.cboWeightCheck.value & " third part of string"

or

strMyString="First Part of string " & Me.cboWeightCheck.value & " third part of string"
Me.lblProd.Caption=strMyString

Bryan
 

smirnoff

Registered User.
Local time
Today, 14:56
Joined
Apr 8, 2005
Messages
13
I tried all that and I get an error of " You entered an expression that has no value"

I dont think I explained my problem very well. I have a field in a combo box type display on my report, and I would like to enter it into a label string.

thanks for the help.
-Ryan
 

Users who are viewing this thread

Top Bottom