Newbie needs to have form highlight certain cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm developing an expense form that will record Time and Expense on the same
form. I would like to know what code will do the following:
If Form.TimeandEXpense = TIME, I want to deactivate Form.MerchantType;
Form.Merchant; Form.ExpenseAmount; and Form.Payment. I know these should be
= False, but I don't know the specific manner in which to write this code.
As I noted ... I'm new and think I know more than I do.
Thanks in advance for you assistance.
 
I don't understand what you mean by TIME. Are you referring to the function
Time() or a bound field or what?
Your subject states "highlight certain cells" and your message says
"deactivate". What do you want? There are no "cells" in Access. I assume you
are referring to text box controls.

You should be able to add code to the On Format event of the form like:

Me.MerchantType.Enabled = Not Me.txtSomeTextBox = SomeValueOrOtherTextBox
 
how about the following:
if Me!TimeandExpense = #TIME# then
Me!MerchantType.Enabled = False
Me!Merchant.Enabled = False
Me!Payment.Enabled = False
end if

Will that do what you want?
You can put this code in the AfterUpdate event code of Timeand Expense
(TimeandExpense_AfterUpdate).

Good Luck,
Alden

Note: Please do not respond to this email address, as it is never checked
and is used to collect unsolicited email.
 
Thanks ABL. That worked. I used quotations around Time and not number sign.
Otherwise all is well.
 
Back
Top