Hi Terry,
Yes, it displays the id instead of the description.
ie. When the screen first displays it populates the combo box with all the statuses. 'Approved', 'Closed' etc.
When I enter a Purchase Order number and fill the dataset, the Combo Box displays the number 5 and it is no longer populated with the statuses.
Here is the code:
Me.ComboBox1.Da taBindings.Add( New System.Windows. Forms.Binding(" Tag", Me.DsPurchaseOr der1, "POHEADER.PO_PO NO"))
Me.ComboBox1.Da taBindings.Add( New System.Windows. Forms.Binding(" Text", Me.DsPurchaseOr der1, "POHEADER.PO_ST ATUS"))
Me.ComboBox1.Da taBindings.Add( New System.Windows. Forms.Binding(" SelectedValue", Me.DsPurchaseOr der1, "POHEADER.PO_ST ATUS"))
Me.ComboBox1.Da taSource = Me.DsPurchaseOr der1.STATUS
Me.ComboBox1.Di splayMember = "STATUS_DES C"
Me.ComboBox1.Lo cation = New System.Drawing. Point(464, 121)
Me.ComboBox1.Na me = "ComboBox1"
Me.ComboBox1.Si ze = New System.Drawing. Size(120, 21)
Me.ComboBox1.Ta bIndex = 63
Me.ComboBox1.Ta g = ""
Me.ComboBox1.Va lueMember = "STATUS_ID"
Thanks for your help.
Regards,
Marnie.
"One Handed Man ( OHM - Terry Burns )" wrote:
What do you mean when you say the Combo box 'Gets' the STATUS_ID, do you
mean that is what is displayed ?
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Time flies when you don't know what you're doing
"SoftWhiteDelgi ht" <So************ **@discussions. microsoft.com> wrote in
message news:79******** *************** ***********@mic rosoft.com... Help me. I am obviously stupid! :-)
I am just starting out with VB.Net and am trying to do a simple
master/detail form with a SqlServer backend. I have created a combo box which is to populate with 'STATUS_DESC' from
the STATUS table. This works perfectly.
Now I want to populate the form with a row from the Purchase Order table
POHEADER and expect the combo box to get the 'STATUS_DESC' by looking up
the STATUS table with POHEADER.STATUS _ID. How come when I fill the dataset, the combo box gets the STATUS_ID
instead?
I have the following values in the combo box properties:
DataSource: DsPurchaseOrder 1.STATUS
DisplayMember: STATUS_DESC
ValueMember: STATUS_ID
In my book it talks about the 'SelectedValue' property but I can't seem to
find that anywhere in the properties dialog. Please help! How do i get it to lookup the description once it's retrieved
the STATUS_ID from the Dataset?
THANKS!!