R
Robert T
Hello:
I have a simple little checkbook application that has a text field called
[Trans_Type]. The only two choices are "Debit" and "Credit". There are two
currency fields, [Debits] and [Credits] that should be enabled or disabled
depening upon selection made in the Trans_Type field. In other words, if it
is a "debit", then the [credits] currency field should be disabled and the
opposite is true.
The script works perfectly wnen moving from record to record, however, it
does NOT work during Data Entry and that's really the purpose of the script.
If I'm entering a new record, the debits field is always grayed out and the
credits field is always enabled, even if I select "Debit" in the Trans_Type
field.
Here is the OnCurrent Event script, I'm hoping someone can explain what I'm
doing wrong.
Private Sub Form_Current()
'If the field Trans_Type is a Debit, Disable the Credits Field
'If the field Trans_Type is a Credit, Disable the Debits Field
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
Thanks,
RT
I have a simple little checkbook application that has a text field called
[Trans_Type]. The only two choices are "Debit" and "Credit". There are two
currency fields, [Debits] and [Credits] that should be enabled or disabled
depening upon selection made in the Trans_Type field. In other words, if it
is a "debit", then the [credits] currency field should be disabled and the
opposite is true.
The script works perfectly wnen moving from record to record, however, it
does NOT work during Data Entry and that's really the purpose of the script.
If I'm entering a new record, the debits field is always grayed out and the
credits field is always enabled, even if I select "Debit" in the Trans_Type
field.
Here is the OnCurrent Event script, I'm hoping someone can explain what I'm
doing wrong.
Private Sub Form_Current()
'If the field Trans_Type is a Debit, Disable the Credits Field
'If the field Trans_Type is a Credit, Disable the Debits Field
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
Thanks,
RT