How to use a check box to determine payment method?

G

Guest

For my invoices there are two payment methods - either full amount on 30 day
account, or 10% with order, 40% 6 weeks before delivery and 50% on delivery.

On my sales order inpute form I would like to have a check box to chose
whether or it's stage payments or on account. Default will be stage payments.
I'll use 4 text boxes with calculated fields to display the total for an
account payment and due date, or the 3 stage payments.

The easiest way I can think to toggle between the two payment options is
have the check box show/hide the stage payments text boxes and invoice print
button or hide the account text box and invoice print button depending on
which is selected.

So what code do I use for show and hide based on the checkbox value? And
where do I put it? Is it an after update on the checkbox?

Thanks in advance.
 
W

Wayne Morgan

To show/hide the textboxes, use the AfterUpdate event of the checkbox and
the Current event of the form. The AfterUpdate of the checkbox will
show/hide the textboxes when you change the selection in the checkbox, the
Current event of the form will show/hide the textboxes when you move from
one record to the next, depending on the value of the checkbox.

The code to show/hide the textboxes is:
Me.txtTextbox1.Visible = Me.chkCheckbox1
Me.txtTextbox2.Visible = Me.chkCheckbox1
Me.txtTextbox3.Visible = Not Me.chkCheckbox1

The Visible property accepts True or False as a value. The checkbox will
return True or False, depending on whether or not it is checked. The Not
keyword will reverse the value, so in the third line, if the checkbox is
checked, txtTextbox3 will be hidden.
 

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