Got Focus Problem

N

nybaseball22

Hello,

I have a tabular form where the Got Focus Code is to activate and
deactivate certain fields based on my selection in one of the fields.
However, when the load happens, it applies the code to the selection
from the first record on the form only. Is there a way to change the
code so that it will apply to each individual record? I have it set
for the Got Focus on my date field, as this is the first field on all
of the forms. I could add it to the form for On Load, etc, but it
isn't working. If you know how to make it work, I am certainly
willing to make a change. The code reads:

If Me.Transaction_Type = "Deposit" Then
Me.Withdraw_Amount.Enabled = False
Me.Expense_Class.Enabled = False
Me.Payment_Method.Enabled = False
Me.Deposit_Amount.Enabled = True
ElseIf Me.Transaction_Type = "Withdraw" Then
Me.Withdraw_Amount.Enabled = True
Me.Expense_Class.Enabled = True
Me.Payment_Method.Enabled = True
Me.Deposit_Amount.Enabled = False
Else
' Any other options
End If


Thanks for the help.
 
P

Pieter Wijnen

Should be placed (Called) in the OnCurrent Event & probably in the
Transaction_Type AfterUpdate Event

Pieter
 
N

nybaseball22

Thank you. There is still the problem that it applies the code the
same to all the records based on the selection in the first record.
Is there a way to have it look at all the records individually?

Thanks again.
 
D

Douglas J. Steele

Actually, it won't be the same for all records based on the selection in the
first record. It'll be the same for all records based on the selection of
the current record. In other words, it'll be correct for the current row,
and since you can't make changes to a row unless it's current, it shouldn't
really matter that it's wrong for other rows.

It's not possible to have different behaviour on different rows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top