Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem with databound combobox

Problem with databound combobox

Scheduled Pinned Locked Moved Visual Basic
helpdatabasequestionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kutz9
    wrote on last edited by
    #1

    Hi all, I am having a problem with a databound combobox in that when I save the record (ie, end current edit,update the database and accept the changes) the combobox resets its value back to the first object in the list. Anyone else experienced this problem before? My code for saving goes something like this. 'MsgBox("Record Saved") 'Create a new dataset to hold the changes that have been made to the main dataset. Dim objDataSetChanges As Buckner_Intranet.dsNCR = New Buckner_Intranet.dsNCR 'Stop any current edits. Me.BindingContext(DsNCR1, "NCR").EndCurrentEdit() Me.BindingContext(Me.DsNCR1, "Responses").EndCurrentEdit() 'Get the changes that have been made to the main dataset. objDataSetChanges = CType(DsNCR1.GetChanges, Buckner_Intranet.dsNCR) 'Check to see if any changes have been made. If (Not (objDataSetChanges) Is Nothing) Then Try Me.BindingContext(Me.DsNCR1, "NCR").EndCurrentEdit() Me.BindingContext(Me.DsNCR1, "Responses").EndCurrentEdit() daNCR.Update(Me.DsNCR1, "NCR") daResponses.Update(Me.DsNCR1, "Responses") Catch eUpdate As System.Exception MsgBox(eUpdate.Message) End Try 'Commit the changes that were just merged 'This moves any rows marked as updated, inserted or changed to being marked as original values DsNCR1.AcceptChanges() End If Cheers for any help you might be able to offer. Kutz _____________________ Don't take out the Magic Pen, Don't draw on the Infinity Board - Neil Young

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups