Default Value

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
 
J

Jeff Boyce

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/
 
S

storrboy

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.
 
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.

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!
 

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

Top