S
scubadiver
I have a problem.
I have a drop down combo box called "Query status" with two options:
"outstanding" and "completed".
The record can't be changed to "completed" until certain other fields have
ALL been entered but there is an extra complication. One other combo box can
be either "other" or "invoice". Two extra fields need to be entered if this
combo is "invoice" otherwise they aren't mandatory.
In full this is the code I currently have in the "after update" event of
each field:
If Me.Qry_QryType = "invoice" And Not IsNull(Me!Cont_InvName) And Not
IsNull(Me!Qry_ProdType) And Not IsNull(Me!Qry_CCDesc1) And Not
IsNull(Me!Qry_CntType) And Not IsNull(Me!SLA_Date2) And Not
IsNull(Me!SLA_Date3) And Not IsNull(Me!SLA_Date4) And Not
IsNull(Me!SLA_Date5) And Not IsNull(Me!SLA_Date6) And Not
IsNull(Me!SLA_Date7) Then Me.Qry_Status.Locked = False
If Me.Qry_QryType = "invoice" And IsNull(Me!Cont_InvName) And
IsNull(Me!Qry_ProdType) And IsNull(Me!Qry_CCDesc1) And IsNull(Me!Qry_CntType)
And IsNull(Me!SLA_Date2) And IsNull(Me!SLA_Date3) And IsNull(Me!SLA_Date4)
And IsNull(Me!SLA_Date5) And IsNull(Me!SLA_Date6) And IsNull(Me!SLA_Date7)
Then Me.Qry_Status.Locked = True
If Me.Qry_QryType <> "invoice" And Not IsNull(Me!Cont_InvName) And Not
IsNull(Me!Qry_ProdType) And Not IsNull(Me!Qry_CCDesc1) And Not
IsNull(Me!Qry_CntType) And Not IsNull(Me!SLA_Date2) And Not
IsNull(Me!SLA_Date3) And Not IsNull(Me!SLA_Date4) And Not
IsNull(Me!SLA_Date5) Then Me.Qry_Status.Locked = False
If Me.Qry_QryType <> "invoice" And IsNull(Me!Cont_InvName) And
IsNull(Me!Qry_ProdType) And IsNull(Me!Qry_CCDesc1) And IsNull(Me!Qry_CntType)
And IsNull(Me!SLA_Date2) And IsNull(Me!SLA_Date3) And IsNull(Me!SLA_Date4)
And IsNull(Me!SLA_Date5) Then Me.Qry_Status.Locked = True
I am sure there must be a simpler way...
I have a drop down combo box called "Query status" with two options:
"outstanding" and "completed".
The record can't be changed to "completed" until certain other fields have
ALL been entered but there is an extra complication. One other combo box can
be either "other" or "invoice". Two extra fields need to be entered if this
combo is "invoice" otherwise they aren't mandatory.
In full this is the code I currently have in the "after update" event of
each field:
If Me.Qry_QryType = "invoice" And Not IsNull(Me!Cont_InvName) And Not
IsNull(Me!Qry_ProdType) And Not IsNull(Me!Qry_CCDesc1) And Not
IsNull(Me!Qry_CntType) And Not IsNull(Me!SLA_Date2) And Not
IsNull(Me!SLA_Date3) And Not IsNull(Me!SLA_Date4) And Not
IsNull(Me!SLA_Date5) And Not IsNull(Me!SLA_Date6) And Not
IsNull(Me!SLA_Date7) Then Me.Qry_Status.Locked = False
If Me.Qry_QryType = "invoice" And IsNull(Me!Cont_InvName) And
IsNull(Me!Qry_ProdType) And IsNull(Me!Qry_CCDesc1) And IsNull(Me!Qry_CntType)
And IsNull(Me!SLA_Date2) And IsNull(Me!SLA_Date3) And IsNull(Me!SLA_Date4)
And IsNull(Me!SLA_Date5) And IsNull(Me!SLA_Date6) And IsNull(Me!SLA_Date7)
Then Me.Qry_Status.Locked = True
If Me.Qry_QryType <> "invoice" And Not IsNull(Me!Cont_InvName) And Not
IsNull(Me!Qry_ProdType) And Not IsNull(Me!Qry_CCDesc1) And Not
IsNull(Me!Qry_CntType) And Not IsNull(Me!SLA_Date2) And Not
IsNull(Me!SLA_Date3) And Not IsNull(Me!SLA_Date4) And Not
IsNull(Me!SLA_Date5) Then Me.Qry_Status.Locked = False
If Me.Qry_QryType <> "invoice" And IsNull(Me!Cont_InvName) And
IsNull(Me!Qry_ProdType) And IsNull(Me!Qry_CCDesc1) And IsNull(Me!Qry_CntType)
And IsNull(Me!SLA_Date2) And IsNull(Me!SLA_Date3) And IsNull(Me!SLA_Date4)
And IsNull(Me!SLA_Date5) Then Me.Qry_Status.Locked = True
I am sure there must be a simpler way...