Default Value

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Hello Experts,

Question regarding the 'Default' value on a Form.

I'm trying to use the IIF Function to populate one control based on
another.

The control that I'm trying to populate is a text box, while the other
control is a check box.

With the expression builder on the 'Default Value' line I've entered
the following:

=if([TAXABLE],"PLEASE NOTE TAX","")

This is not working...any suggestions?

Since the TAXABLE control is a yes/no true/false, when the box
[TAXABLE] is checked, the text box should say "PLEASE NOTE TAX", else
it should be null.

alex
 
Alex

Use the checkbox's AfterUpdate event, and an If/Then statement, to set the
value of your textbox control. It might look something like:

If Me!chkYourCheckbox = True Then
Me!txtYourTextbox = "Please Note Tax"
Else
Me!txtYourTextbox = ""
End If

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Hello Experts,

Question regarding the 'Default' value on a Form.

I'm trying to use the IIF Function to populate one control based on
another.

The control that I'm trying to populate is a text box, while the other
control is a check box.

With the expression builder on the 'Default Value' line I've entered
the following:

=if([TAXABLE],"PLEASE NOTE TAX","")

This is not working...any suggestions?

Since the TAXABLE control is a yes/no true/false, when the box
[TAXABLE] is checked, the text box should say "PLEASE NOTE TAX", else
it should be null.

alex


Jeff's advice is better than using the default value property, but I'd
like to point out that in your example you have IF not IIF (2 i's),
wich may be why it's not working at all.
 
Hello Experts,
Question regarding the 'Default' value on a Form.
I'm trying to use the IIF Function to populate one control based on
another.
The control that I'm trying to populate is a text box, while the other
control is a check box.
With the expression builder on the 'Default Value' line I've entered
the following:
=if([TAXABLE],"PLEASE NOTE TAX","")
This is not working...any suggestions?
Since the TAXABLE control is a yes/no true/false, when the box
[TAXABLE] is checked, the text box should say "PLEASE NOTE TAX", else
it should be null.

Jeff's advice is better than using the default value property, but I'd
like to point out that in your example you have IF not IIF (2 i's),
wich may be why it's not working at all.- Hide quoted text -

- Show quoted text -

Great advice--thank you both!
 
Back
Top