Thanks a ton Steve.. My problem has been solved after a little exploration in the enable conditions. Regards Varun
Buggedforever
Posts
-
Update button greyed out -
Update button greyed outThanks for your response Steve..Havn't tried it yet but definitely share it with you..Regarding the GoTo..well the code is legacy code so can't do much :) Thanks ~Varun
-
Update button greyed outI regret the inconvenience caused with the lengthy code pasted earlier.I'll put my query again. I am using a front end to enter some records.However for a particular record the update button is greyed out. code for update button. Private Sub cmdUpdate0_Click() Dim strAgreeStatus As String Call m_frmParent.ZOrder(0) strAgreeStatus = txtText0(idxMaintAgreeStatus).Text If Edit_Neg > 0 Then Exit Sub End If If Edit_Agree > 0 Then Exit Sub End If On Error GoTo ERR_ROUTINE Me.MousePointer = vbHourglass If strAgreeStatus = "A" Then m_objAgreement.DoFullEdits = "Y" Else m_objAgreement.DoFullEdits = "N" End If FMain.staMain.Panels(1).Text = "" DoEvents If ValidateAll0 > 0 Then FMain.staMain.Panels(1).Text = "Unable to Update. Check fields in red." GoTo SUBEND End If DoEvents If m_objAgreement.Update < 1 Then Call MsgBox("Agreement not found. " & vbCrLf & _ "", vbExclamation & vbOKOnly, "Unable to Update.") Else cboCombo0(idxMaintAgreementType).SetFocus FMain.staMain.Panels(1).Text = "Update Successful." End If SUBEND: cboCombo0(idxMaintAgreementType).SetFocus Me.MousePointer = vbNormal Exit Sub ERR_ROUTINE: If Err.Number = boAgreeErrRequired Then Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Required Data Missing") ElseIf Err.Number = boAgreeErrValidation Then Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Data Validation Error") Else Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Error") End If Me.MousePointer = vbNormal End Sub Thanks in advance. ~Varun
-
Update button is greyed outthe 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