I
Ian
I keep getting erroneous error messages and the allowedits property set
wrong. What I need to do is evaluate a combobox (contract/combo14) for 4
things prior to letting it be updated:
I want to be able to edit it if:
It is the next record (null)
Is is an active contract (sum of active status =-1)
I want it locked if:
there are records associated with that contract (count services <>0)
or it is an inactive contract. I've tried a variety of If then and thought
this might work and set the GotFocus() for Combo14 to Allowedits = True
Private Sub Combo14_mousedown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If (IsNull(Combo14) Or (DSum("active", "LU_contracttypes",
"contracttype=forms.frm_main.frm_contracts.form.combo14") = -1)) Then
Me.AllowEdits = True
Else
If DCount("render", "services",
"contractID=forms.frm_main.frm_contracts.form.contractid") <> 0 Then
Me.AllowEdits = False
MsgBox "Contract has services assinged and cannot be altered. Delete
Services then alter Contract", 16
Else
Me.AllowEdits = False
MsgBox "Inactive Contract: Cannot be altered", 16
End If
End If
End Sub
wrong. What I need to do is evaluate a combobox (contract/combo14) for 4
things prior to letting it be updated:
I want to be able to edit it if:
It is the next record (null)
Is is an active contract (sum of active status =-1)
I want it locked if:
there are records associated with that contract (count services <>0)
or it is an inactive contract. I've tried a variety of If then and thought
this might work and set the GotFocus() for Combo14 to Allowedits = True
Private Sub Combo14_mousedown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If (IsNull(Combo14) Or (DSum("active", "LU_contracttypes",
"contracttype=forms.frm_main.frm_contracts.form.combo14") = -1)) Then
Me.AllowEdits = True
Else
If DCount("render", "services",
"contractID=forms.frm_main.frm_contracts.form.contractid") <> 0 Then
Me.AllowEdits = False
MsgBox "Contract has services assinged and cannot be altered. Delete
Services then alter Contract", 16
Else
Me.AllowEdits = False
MsgBox "Inactive Contract: Cannot be altered", 16
End If
End If
End Sub