Update button is greyed out
-
the code below is for an application through whose front end i update relevant info like agreement etc...The problem is when I am trying to enter an agreement the 'UPDATE' button is greyed out(Inactive). The issue seems to be in Private Sub cmdUpdate0_Click() The code below is for the whole form. CODE STARTS ( Option Explicit Private m_objAgreement As CAgreement Private m_objAgreeDetail As CAgreeDetail Private m_objCode As CCode Private m_objCompGroup As CCompGroup Private m_objDivision As CDivision Private m_objEmployee As CEmployee Private m_objNegotiation As CNegotiation Private m_objPart As CPart Private m_objSupplier As CSupplier Private m_frmSupSearch As frmSupSearch Private m_rsNegCode As Recordset Private m_rsAgreeNo As Recordset Private m_frmAddCompGroup As frmAddCompGroup Private m_blnInitialCall As Boolean Private m_blnBeenOnTab0 As Boolean Private m_blnBeenOnTab1 As Boolean Private m_blnBeenOnTab2 As Boolean Private m_blnBeenOnTab3 As Boolean Private m_intInValidCnt As Integer ' Required fields only Private m_frmParent As Form 'Ref to FMenuHost Parent form Private m_blnCallFromMenu As Boolean Private m_strAgree0 As String Private m_strAgree1 As String Private m_strAgree2 As String Private m_strAgree3 As String Private m_strCommitmentType As String Private m_strPrevNegCode As String Private Enum idxMaint idxMaintCommitmentType = 0 idxMaintAgreementType = 1 idxMaintNegotiatedCurrency = 2 idxMaintAgreeStatus = 3 idxMaintStartDate = 4 idxMaintEndDate = 5 idxMaintFinalShipDate = 6 idxMaintPercentShare = 7 idxMaintScope = 8 idxMaintPreferredUOM = 9 idxMaintDiscountPercent = 10 idxMaintDiscountDays = 11 idxMaintNetDays = 12 idxMaintReturnAuthorization = 13 idxMaintAgreeComments = 14 End Enum Private Enum tabIndex tabMaint = 0 tabAddPart = 1 tabPrice = 2 tabCopy = 3 End Enum Private Enum lvlLevel lvlAgreement = 1 lvlCompGroup = 2 lvlPart = 3 lvlDivision = 4 End Enum Private Const NegCodeMaxLength = 4 Private Const AgreeNoMaxLength = 8 Private Const CopyAgreeJobId = "m4110" Private Sub Form_Load() On Error GoTo ERR_ROUTINE Set m_objAgreement = New CAgreement Set m_objAgreeDetail = New CAgreeDetail Call PopulateNeg m_blnCallFromMenu = True
-
the code below is for an application through whose front end i update relevant info like agreement etc...The problem is when I am trying to enter an agreement the 'UPDATE' button is greyed out(Inactive). The issue seems to be in Private Sub cmdUpdate0_Click() The code below is for the whole form. CODE STARTS ( Option Explicit Private m_objAgreement As CAgreement Private m_objAgreeDetail As CAgreeDetail Private m_objCode As CCode Private m_objCompGroup As CCompGroup Private m_objDivision As CDivision Private m_objEmployee As CEmployee Private m_objNegotiation As CNegotiation Private m_objPart As CPart Private m_objSupplier As CSupplier Private m_frmSupSearch As frmSupSearch Private m_rsNegCode As Recordset Private m_rsAgreeNo As Recordset Private m_frmAddCompGroup As frmAddCompGroup Private m_blnInitialCall As Boolean Private m_blnBeenOnTab0 As Boolean Private m_blnBeenOnTab1 As Boolean Private m_blnBeenOnTab2 As Boolean Private m_blnBeenOnTab3 As Boolean Private m_intInValidCnt As Integer ' Required fields only Private m_frmParent As Form 'Ref to FMenuHost Parent form Private m_blnCallFromMenu As Boolean Private m_strAgree0 As String Private m_strAgree1 As String Private m_strAgree2 As String Private m_strAgree3 As String Private m_strCommitmentType As String Private m_strPrevNegCode As String Private Enum idxMaint idxMaintCommitmentType = 0 idxMaintAgreementType = 1 idxMaintNegotiatedCurrency = 2 idxMaintAgreeStatus = 3 idxMaintStartDate = 4 idxMaintEndDate = 5 idxMaintFinalShipDate = 6 idxMaintPercentShare = 7 idxMaintScope = 8 idxMaintPreferredUOM = 9 idxMaintDiscountPercent = 10 idxMaintDiscountDays = 11 idxMaintNetDays = 12 idxMaintReturnAuthorization = 13 idxMaintAgreeComments = 14 End Enum Private Enum tabIndex tabMaint = 0 tabAddPart = 1 tabPrice = 2 tabCopy = 3 End Enum Private Enum lvlLevel lvlAgreement = 1 lvlCompGroup = 2 lvlPart = 3 lvlDivision = 4 End Enum Private Const NegCodeMaxLength = 4 Private Const AgreeNoMaxLength = 8 Private Const CopyAgreeJobId = "m4110" Private Sub Form_Load() On Error GoTo ERR_ROUTINE Set m_objAgreement = New CAgreement Set m_objAgreeDetail = New CAgreeDetail Call PopulateNeg m_blnCallFromMenu = True
Do you really expect someone to read all that code and try and help you? Try posting only the relevant code.
-
the code below is for an application through whose front end i update relevant info like agreement etc...The problem is when I am trying to enter an agreement the 'UPDATE' button is greyed out(Inactive). The issue seems to be in Private Sub cmdUpdate0_Click() The code below is for the whole form. CODE STARTS ( Option Explicit Private m_objAgreement As CAgreement Private m_objAgreeDetail As CAgreeDetail Private m_objCode As CCode Private m_objCompGroup As CCompGroup Private m_objDivision As CDivision Private m_objEmployee As CEmployee Private m_objNegotiation As CNegotiation Private m_objPart As CPart Private m_objSupplier As CSupplier Private m_frmSupSearch As frmSupSearch Private m_rsNegCode As Recordset Private m_rsAgreeNo As Recordset Private m_frmAddCompGroup As frmAddCompGroup Private m_blnInitialCall As Boolean Private m_blnBeenOnTab0 As Boolean Private m_blnBeenOnTab1 As Boolean Private m_blnBeenOnTab2 As Boolean Private m_blnBeenOnTab3 As Boolean Private m_intInValidCnt As Integer ' Required fields only Private m_frmParent As Form 'Ref to FMenuHost Parent form Private m_blnCallFromMenu As Boolean Private m_strAgree0 As String Private m_strAgree1 As String Private m_strAgree2 As String Private m_strAgree3 As String Private m_strCommitmentType As String Private m_strPrevNegCode As String Private Enum idxMaint idxMaintCommitmentType = 0 idxMaintAgreementType = 1 idxMaintNegotiatedCurrency = 2 idxMaintAgreeStatus = 3 idxMaintStartDate = 4 idxMaintEndDate = 5 idxMaintFinalShipDate = 6 idxMaintPercentShare = 7 idxMaintScope = 8 idxMaintPreferredUOM = 9 idxMaintDiscountPercent = 10 idxMaintDiscountDays = 11 idxMaintNetDays = 12 idxMaintReturnAuthorization = 13 idxMaintAgreeComments = 14 End Enum Private Enum tabIndex tabMaint = 0 tabAddPart = 1 tabPrice = 2 tabCopy = 3 End Enum Private Enum lvlLevel lvlAgreement = 1 lvlCompGroup = 2 lvlPart = 3 lvlDivision = 4 End Enum Private Const NegCodeMaxLength = 4 Private Const AgreeNoMaxLength = 8 Private Const CopyAgreeJobId = "m4110" Private Sub Form_Load() On Error GoTo ERR_ROUTINE Set m_objAgreement = New CAgreement Set m_objAgreeDetail = New CAgreeDetail Call PopulateNeg m_blnCallFromMenu = True
Hi, I can see that this is your first post here so before posting again I would read the message at the top of this board on how to ask a question. You have supplied way too much code here and because it isn't formatted, some people won't even read it. With regards to your problem, what I suggest you do is place a break point in your code and step through it, checking the conditions that will result in cmdUpdate0.Enabled equalling false.
-
the code below is for an application through whose front end i update relevant info like agreement etc...The problem is when I am trying to enter an agreement the 'UPDATE' button is greyed out(Inactive). The issue seems to be in Private Sub cmdUpdate0_Click() The code below is for the whole form. CODE STARTS ( Option Explicit Private m_objAgreement As CAgreement Private m_objAgreeDetail As CAgreeDetail Private m_objCode As CCode Private m_objCompGroup As CCompGroup Private m_objDivision As CDivision Private m_objEmployee As CEmployee Private m_objNegotiation As CNegotiation Private m_objPart As CPart Private m_objSupplier As CSupplier Private m_frmSupSearch As frmSupSearch Private m_rsNegCode As Recordset Private m_rsAgreeNo As Recordset Private m_frmAddCompGroup As frmAddCompGroup Private m_blnInitialCall As Boolean Private m_blnBeenOnTab0 As Boolean Private m_blnBeenOnTab1 As Boolean Private m_blnBeenOnTab2 As Boolean Private m_blnBeenOnTab3 As Boolean Private m_intInValidCnt As Integer ' Required fields only Private m_frmParent As Form 'Ref to FMenuHost Parent form Private m_blnCallFromMenu As Boolean Private m_strAgree0 As String Private m_strAgree1 As String Private m_strAgree2 As String Private m_strAgree3 As String Private m_strCommitmentType As String Private m_strPrevNegCode As String Private Enum idxMaint idxMaintCommitmentType = 0 idxMaintAgreementType = 1 idxMaintNegotiatedCurrency = 2 idxMaintAgreeStatus = 3 idxMaintStartDate = 4 idxMaintEndDate = 5 idxMaintFinalShipDate = 6 idxMaintPercentShare = 7 idxMaintScope = 8 idxMaintPreferredUOM = 9 idxMaintDiscountPercent = 10 idxMaintDiscountDays = 11 idxMaintNetDays = 12 idxMaintReturnAuthorization = 13 idxMaintAgreeComments = 14 End Enum Private Enum tabIndex tabMaint = 0 tabAddPart = 1 tabPrice = 2 tabCopy = 3 End Enum Private Enum lvlLevel lvlAgreement = 1 lvlCompGroup = 2 lvlPart = 3 lvlDivision = 4 End Enum Private Const NegCodeMaxLength = 4 Private Const AgreeNoMaxLength = 8 Private Const CopyAgreeJobId = "m4110" Private Sub Form_Load() On Error GoTo ERR_ROUTINE Set m_objAgreement = New CAgreement Set m_objAgreeDetail = New CAgreeDetail Call PopulateNeg m_blnCallFromMenu = True
Absolutely noone is going to look through all that code to try and find out what your problem is. You should only post the RELEVANT portions of code, not the entire fricken' project.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Absolutely noone is going to look through all that code to try and find out what your problem is. You should only post the RELEVANT portions of code, not the entire fricken' project.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Dave Kreskowiak wrote:
Absolutely noone is going to look through all that code
Is that a challenge? ;)
Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.
-
Dave Kreskowiak wrote:
Absolutely noone is going to look through all that code
Is that a challenge? ;)
Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.
Not really, but if you felt so inclined, please...far be it from me to hold you back. ;)
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...