4 Replies - 502 Views - Last Post: 03 September 2009 - 05:46 PM Rate Topic: -----

#1 mrleon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-September 09

SelectedValue

Post icon  Posted 03 September 2009 - 04:19 AM

cboName.DataSource = Me.CustomersTableAdapter.GetDataByFullName
		cboName.DisplayMember = "FullName"
		cboName.ValueMember = "CWID"
		'cboname.SelectedValue = 



How do I retrieve the selected value.
Is This A Good Question/Topic? 0
  • +

Replies To: SelectedValue

#2 bflosabre91  Icon User is offline

  • go sabres

Reputation: 105
  • View blog
  • Posts: 1,439
  • Joined: 22-February 08

Re: SelectedValue

Posted 03 September 2009 - 06:47 AM

you have it commented out... is that not working? Either of these should return what the combobox value is. Not sure what your having trouble with there cause it seems like u have the right idea..?

cboName.SelectedValue

cboName.Text


Was This Post Helpful? 0
  • +
  • -

#3 mrleon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-September 09

Re: SelectedValue

Posted 03 September 2009 - 01:01 PM

View Postbflosabre91, on 3 Sep, 2009 - 05:47 AM, said:

you have it commented out... is that not working? Either of these should return what the combobox value is. Not sure what your having trouble with there cause it seems like u have the right idea..?

cboName.SelectedValue

cboName.Text



If I hooked this up in design mood it would look like this
cboName.SelectedValue = computersbindingsource - CWID

How do you hook this up in code?

I am trying to pass the selected value to my computer table
but this does not work in code what would be the equivialant value in code. I am trying to get my customers and computers synced in my cboName_SelectedIndexChanged1 event and it is not working


Private Sub cboName_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboName.SelectedIndexChanged
		Dim serial As String = SerialNumberTextBox.Text
		'Dim cwid As String = cboName.Text
		'Me.AMSDataSet.EnforceConstraints = False
		cboName.DataSource = Me.CustomersTableAdapter.GetDataByFullName()
		cboName.DisplayMember = "FullName"
		cboName.ValueMember = "CWID"
		'cboname.SelectedValue = 

		Me.ComputersTableAdapter.Fill(Me.AMSDataSet.Computers)
		'Me.SoftwareTableAdapter.GetDataBySerial(serial)
		'Me.CustSoftTableAdapter.FillBySerialNumber(serial)
	End Sub


Was This Post Helpful? 0
  • +
  • -

#4 Sethro117  Icon User is offline

  • Still the sexiest mofo.
  • member icon

Reputation: 236
  • View blog
  • Posts: 2,378
  • Joined: 14-January 09

Re: SelectedValue

Posted 03 September 2009 - 01:42 PM

You still have it commented out. If you're wanting to see the selected value try something like :
MsgBox(CboName.SelectedItem)


That will display in a MessagBox the text of the item the user selected from that ComboBox
Was This Post Helpful? 0
  • +
  • -

#5 mrleon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-September 09

Re: SelectedValue

Posted 03 September 2009 - 05:46 PM

View Postsh250080, on 3 Sep, 2009 - 12:42 PM, said:

You still have it commented out. If you're wanting to see the selected value try something like :
MsgBox(CboName.SelectedItem)


That will display in a MessagBox the text of the item the user selected from that ComboBox

OK let me start over. I have a dataset with 4 tables :

Customers 1:M Computers 1:M CompSoft M:1 Software
PK - CWID PK - ComputerID PK - ComputerID PK - SoftwareID
PK - SoftwareID

And I have a form that I am trying to build with computers and software but I also have a combobox on the form that I have populated with the Customers and I am trying to select a customer from the combobox and the form show the computer related to that customer and the software related to that computer. I tried doing this in design mode and I can get the computers to change when I make a selection but the software does not change how can I get that portion to work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1