I'm Back - Need final code.....

MeisterGirl

Registered User.
Local time
Today, 07:10
Joined
Aug 8, 2001
Messages
11
Okay - I am almost done with the form. I'm sure you guys are glad to hear that!
I have 4 business rules that I have been asked to incorpoarate into the form - here is what I need to finsih up...

1. A value for Intr_Code is required ONLY if Prod_Grp = EA or TR. Code for this?

2. If Month_Fee is >1 then Fee_Typ requires a value.
For this one I have another field - OCP - that is also required if Month_Fee >1. I used the following code for that rule is there a way to consolidate the two:

Private Sub Form_BeforeUpdate(Cancel As Integer)
'Set the OCP codes when there is a monthly fee'
Select Case Month_Fee
Case Is > 1
If IsNull(OCP) Then
Cancel = True
MsgBox "You must enter an Optional Calling Plan Code - OCP.", vbExclamation
OCP.SetFocus
End If
End Select

Exit Sub


3. A value for the COCOT field is required if Prod_Grp = TR,HD or IN and the value needs to default to $0.25. Can this rule be consolidated with the rule for #1 above regarding the Intr_Code?

4. Last but not least Comm_Prod is a yes/no field. If the user checks the box meaning "yes" then Comm_Amt requires a value.

I know there has to be a way to put all this together cleanly on a sub form but I have no idea how. Ijust want to complete this project so I can go back to being a "non-coder".....

Thanks Everyone!!
 
Question 1 & 3
Something like this?

Sub Intr_Code AfterUpdate()

Dim ProdGrp$

ProdGrp$ = Prod_Grp.Text

Select Case ProdGrp$
Case "EA"
Intr_Code.SetFocus
Intr_Code.ValidationRule = "Not ''"
Intr_Code.ValidationText = "Must have a value"
Intr_Code.Locked = False
Case "HD","IN"
COCOT.DefaultValue = "0.25"
COCOT.Locked = False
Case "TR"
Intr_Code.SetFocus
Intr_Code.ValidationRule = "> ''"
Intr_Code.ValidationText = "Must have a value"
Intr_Code.Locked = False
COCOT.DefaultValue = "0.25"
COCOT.Locked = False
Case Else
Intr_Code.SetFocus
Intr_Code.Value = ""
Intr_Code.Locked = True
End Select

[This message has been edited by sned (edited 08-22-2001).]
 

Users who are viewing this thread

Back
Top Bottom