By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,248 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,248 IT Pros & Developers. It's quick & easy.

help with check boxes

P: n/a
Hi, I am trying to show a value in a field when a check box is checked,
example: if the box is checked, value of $ 15.00 appears. What is the
function or expression for this?

Thank you

Kai St-Louis
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.528 / Virus Database: 324 - Release Date: 10/16/2003
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> Hi, I am trying to show a value in a field when a check box is checked,
example: if the box is checked, value of $ 15.00 appears. What is the
function or expression for this?


If this value is to be displayed in a calculated control (the value isn't going
to be stored), then you can set the control's "control source" to:

=IIF(Me.chkBox.Value, 15, 0)

If you want to assign the value to a control bound to a field in the form's
recordsource you could do it this way:

'****
If Me.chkBox.Value Then
Me.MyControlName.Value = 15
Else
Me.MyControlName.Value = 0 'Or "Null", if more appropriate
End If
'****

In either of the examples above, set the control's "Format" property to
"Currency".

I generally discourage the use of hard-coded values, so, if this value is likely
to change you should store it in a table and then you can look it up using the
"DLookup()" function or a recordset when needed.

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.