help with check boxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kai St-Louis

    #1

    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


  • Bruce M. Thompson

    #2
    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.MyControlNam e.Value = 15
    Else
    Me.MyControlNam e.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.o rg (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.<<


    Comment

    Working...