shankbanta
Technical User
In my form there are three check boxes. Depending on the selection (1, 2 or 3) other fields got/lost focus, special effects, etc. Here is the code:
************************************************************
Private Sub Form_Current()
If (test = 0) Then
Forms!BTDENTRY!select = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
ElseIf (test = 1) Then
Forms!BTDENTRY!BanCovQty.Enabled = True
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = True
Forms!BTDENTRY![ban text].SpecialEffect = 1
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.SpecialEffect = 2
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(230, 10, 79)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
ElseIf (test = 2) Then
Forms!BTDENTRY!CustCovQty.Enabled = True
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY![cus text].SpecialEffect = 1
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 2
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.BackColor = RGB(230, 30, 70)
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Me!Endsheets.TabStop = No
Me!EndQty.TabStop = No
Me!EndShtSavedFrame.TabStop = No
ElseIf (test = 3) Then
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.BackColor = RGB(230, 30, 70)
Else
Forms!BTDENTRY!select = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
End If
Forms!BTDENTRY!LowBindCt.Enabled = False
End Sub
***********************************************************
What I am trying to accomplish:
User checks #2 and enters a number into the corresponding field (CustCovQty)and then realizes they should have entered the information with check #1 (BanCovQty). The number that they entered into CustCovQty (Corresponding to check #2) stays. I would like to have that changed to zero when check #1 is selected.
I hope this is clear, if not ask plenty of questions.
I am picking up someone elses code.
Thanks
************************************************************
Private Sub Form_Current()
If (test = 0) Then
Forms!BTDENTRY!select = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
ElseIf (test = 1) Then
Forms!BTDENTRY!BanCovQty.Enabled = True
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = True
Forms!BTDENTRY![ban text].SpecialEffect = 1
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.SpecialEffect = 2
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(230, 10, 79)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
ElseIf (test = 2) Then
Forms!BTDENTRY!CustCovQty.Enabled = True
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY![cus text].SpecialEffect = 1
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 2
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.BackColor = RGB(230, 30, 70)
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Me!Endsheets.TabStop = No
Me!EndQty.TabStop = No
Me!EndShtSavedFrame.TabStop = No
ElseIf (test = 3) Then
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.BackColor = RGB(230, 30, 70)
Else
Forms!BTDENTRY!select = 0
Forms!BTDENTRY!BanCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY!CustCovQty.BackColor = RGB(193, 193, 193)
Forms!BTDENTRY![cus text].SpecialEffect = 0
Forms!BTDENTRY![ban text].SpecialEffect = 0
Forms!BTDENTRY!BanCovQty.Enabled = False
Forms!BTDENTRY!CustCovQty.Enabled = False
Forms!BTDENTRY!SheetNo.Enabled = False
Forms!BTDENTRY!BanCovQty.SpecialEffect = 0
Forms!BTDENTRY!CustCovQty.SpecialEffect = 0
End If
Forms!BTDENTRY!LowBindCt.Enabled = False
End Sub
***********************************************************
What I am trying to accomplish:
User checks #2 and enters a number into the corresponding field (CustCovQty)and then realizes they should have entered the information with check #1 (BanCovQty). The number that they entered into CustCovQty (Corresponding to check #2) stays. I would like to have that changed to zero when check #1 is selected.
I hope this is clear, if not ask plenty of questions.
I am picking up someone elses code.
Thanks