Using 'Tick Boxes' to determine other values

alunkane

Registered User.
Local time
Today, 11:42
Joined
Sep 2, 2004
Messages
12
There is probably a very simple answer to this, but it has me pulling my hair out.

I have a table with Yes/No values and have turned this into a form with Tick Boxes.

I want to use the results from the tick boxes to determine a monetary values to help work out costs for rented equipment

e.g if a box is ticked value = £3.00 if it's unticked = £0.00, etc...

Any ideas would be much appreciated...
 
One method: -

Code:
Option Explicit
Option Compare Text


Private Sub chkTickBox1_AfterUpdate()

    Me.txtValue1 = 3 * Abs(Nz(Me.chkTickBox1, False))
    
End Sub


Private Sub chkTickBox2_AfterUpdate()

    Me.txtValue2 = 5 * Abs(Nz(Me.chkTickBox2, False))

End Sub
Text box txtValue1 displays 3 if Check Box chkTickBox1 is True else it displays 0.

Obviously the prices would not be hard coded but would be in a table somewhere.

EDIT
Maybe better still…

On Form Open get the prices from the table and write them to the Check Box label.
Then when the Check Box is ticked: -

Code:
Private Sub chkTickBox1_AfterUpdate()

    Me.txtValue1 = Me.lblTickBox1.Caption * Abs(Nz(Me.chkTickBox1, False))
    
End Sub


Hope that helps.

Regards,
Chris.
 
Last edited:
Chris,

Many thanks...

This is maybe more difficult than I first thought, but I'll give it a go...
 

Users who are viewing this thread

Back
Top Bottom