R
Robert T
Hello:
I'm fairly new to access 2003 and I wrote a simple little script that works,
but it only works partially. I wrote a basic checkbook application and I want
to disable certain fields. For example, if Trans_Type = "Debit", I want to
disable the Credits currency field. And if Trans_Type = "Credit", I want to
enable the Credits field and disable the Debits currency field.
I wrote the following script in the form's OnActivate Event. It works on the
first record, which is a "Debit", disabling the Credits currency field.
However, when I move onto a field which has a credit, such as a deposit, the
Debit Field remains enabled while the "Credits" field remains disabled.
'If the field Trans_Type is a Debit, Disable the Credits Field
'If the field Trans_Type is a Credit, Disable the Debits Field
Private Sub Form_Activate()
If (Me.TRANS_TYPE) = "Debit" Then
Me.DEBITS.Enabled = True
Me.CREDITS.Enabled = False
Else
Me.CREDITS.Enabled = True
Me.DEBITS.Enabled = False
End If
End Sub
I'm fairly new to access 2003 and I wrote a simple little script that works,
but it only works partially. I wrote a basic checkbook application and I want
to disable certain fields. For example, if Trans_Type = "Debit", I want to
disable the Credits currency field. And if Trans_Type = "Credit", I want to
enable the Credits field and disable the Debits currency field.
I wrote the following script in the form's OnActivate Event. It works on the
first record, which is a "Debit", disabling the Credits currency field.
However, when I move onto a field which has a credit, such as a deposit, the
Debit Field remains enabled while the "Credits" field remains disabled.
'If the field Trans_Type is a Debit, Disable the Credits Field
'If the field Trans_Type is a Credit, Disable the Debits Field
Private Sub Form_Activate()
If (Me.TRANS_TYPE) = "Debit" Then
Me.DEBITS.Enabled = True
Me.CREDITS.Enabled = False
Else
Me.CREDITS.Enabled = True
Me.DEBITS.Enabled = False
End If
End Sub