skyline666
Programmer
Hi,
I have a bit of a puzzler. I have a form called Category (in form view), and a subform called Risk (in datasheet view) in an Access 2003 project called RiskAnalysis. In the subform I have a combo box field called WBS which gets its value from a stored procedure called usp_WBSChange. The stored procedure returns 4 fields; WBSID (int), WBS (int), WBSDesc (varchar) and Name (varchar). The combo box in the subform only shows the field Name. The code that creates name in the stored procedure is:
So a returned value could be "0 - Danger".
What I would like is to display the value for WBS (being name from stored procedure) on the main form in a text box (or label, whatever!) in the format "WBS : [WBS]", without the quotes and where [WBS] is the returned value and the rest is just normal text.
I have tried doing this already, but what I have done so far returns a error saying "Run-time error 2427: You entered an expression that has no value". The code I have used so far for this is:
Help will, as always, be very much appreciated.
Many thanks,
Andrew
I have a bit of a puzzler. I have a form called Category (in form view), and a subform called Risk (in datasheet view) in an Access 2003 project called RiskAnalysis. In the subform I have a combo box field called WBS which gets its value from a stored procedure called usp_WBSChange. The stored procedure returns 4 fields; WBSID (int), WBS (int), WBSDesc (varchar) and Name (varchar). The combo box in the subform only shows the field Name. The code that creates name in the stored procedure is:
Code:
CAST(CES.dbo.tlbWBS.WBS AS varchar(5)) + ' - ' + CES.dbo.tlbWBS.WBSDescription AS Name
What I would like is to display the value for WBS (being name from stored procedure) on the main form in a text box (or label, whatever!) in the format "WBS : [WBS]", without the quotes and where [WBS] is the returned value and the rest is just normal text.
I have tried doing this already, but what I have done so far returns a error saying "Run-time error 2427: You entered an expression that has no value". The code I have used so far for this is:
Code:
Private Sub Form_Open(Cancel As Integer)
Me.txtWBS.ControlSource = "WBS : " & Me.Risk!WBS
'Me.Requery
End Sub
Help will, as always, be very much appreciated.
Many thanks,
Andrew