none
table does not update. RRS feed

  • Question

  • I use the following methodology to update several tables, but do not get the desired results.

                Case = 8
                    glbintDocNum = CInt(lblDocNum.Text)
                    glbintCRNum = CInt(lblCRNum.Text)
                    glbstrDocRev = CStr(txtRev.Text)
                    'Set document record
                    If glbintDelete = 0 Then
                        'Set document status for cancelled CR
                        Me.TblDMDocMasterTableAdapter.FilterByDocNum(Me._MasterBase1_0DataSet.tblDMDocMaster, CStr(glbintDocNum))
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocEffective = False
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocObsolete = True
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocSupersede = True
                        _MasterBase1_0DataSet.tblDMDocMaster(0).strDocNum = CStr(glbintCRNum)
                        _MasterBase1_0DataSet.tblDMDocMaster(0).strDocRev = glbstrDocRev
                    ElseIf glbintDelete = 1 Then
                        'Set document status for obsoleted document
                        Me.TblDMDocMasterTableAdapter.FilterByDocNum(Me._MasterBase1_0DataSet.tblDMDocMaster, CStr(glbintDocNum))
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocEffective = False
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocObsolete = True
                        _MasterBase1_0DataSet.tblDMDocMaster(0).blnDocSupersede = False
                        _MasterBase1_0DataSet.tblDMDocMaster(0).strDocNum = CStr(glbintCRNum)
                    End If
            End Select
            'Create directory for new CR and document records
            MakeDirectory.DMDocCabinet()
            txtEfile.Text = glbstrEFile
            'prtDocRecord1.Show()
            'Save data inputted into form to dataset
            glbblnSaved = True
            Me.Validate()
            Me.setMBItemNumBindingSource.EndEdit()
            Me.LnkMBChgRequestBindingSource.EndEdit()
            Me.tblDMDocMasterBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me._MasterBase1_0DataSet)

    There are three tables involved in this.  The first is a table that contains the change request data which is placed into that manually from within the form.  That table is lnkMBChgRequest.  The second is the setMBItemNumberBindingSource, which in this Case is not updated.  And the third is tblDMDocMaster, which is where I am running into trouble as the data is not being updated in the table.

    The bolded/italisized code above is where the data is supposed to be placed into the tabe, and as far as I can tell this is all taking place.  However, when I run the endEdit(s) and update commands the tblDMDocMaster table does not update to the new data.

    Let me know what additional information you might need to help in understanding what I have done.


    gwboolean

    Sunday, March 12, 2017 7:09 PM

All replies