Connecting Tech Pros Worldwide Help | Site Map

help with check boxes

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 02:32 PM
Kai St-Louis
Guest
 
Posts: n/a
Default help with check boxes

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



  #2  
Old November 12th, 2005, 02:32 PM
Bruce M. Thompson
Guest
 
Posts: n/a
Default Re: help with check boxes

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

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
bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
>> NO Email Please. Keep all communications[/color][/color]
within the newsgroups so that all might benefit.<<


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.