Macro to run on click of check box

Breezer

Registered User.
Local time
Today, 16:08
Joined
Jun 10, 2003
Messages
10
On an Invoice order form, when the 'Paid' check box is clicked I would like certain textboxes (i.e 'Final date of payment' 'Days since order' and 'Days Overdue' to be deleted. I expect this can be done with a Macro, but have had no luck so far

Thanks for any replies
 
It is better to use VBA than a macro as it is easier to debug and allows error checking. I don't use macros so I cannot give you the commands in the macro but in VBA (select [event procedure] as the event)

Code:
Sub YourCheckbox_OnClick()
if me.nameofcheckbox = true then
me.nameofFinalDateOfPaymentControl = null
me.nameofDaysSinceOrderControl = null
me.nameofDaysOverdueControl = null
end if
end sub

the 'me' refers to the form the controls are on

once you learn VBA, it becomes much more flexible to control your application.
 
Hi Fizzo

Thanks for the prompt reply. I done it it code but one line is obviously wrong..

Private Sub PaidCheckBox_Click()
If Form_OrderForm.PaidCheckBox = True Then
Form_OrderForm.FinalDateOfPayment = Null
Form_OrderForm.DaysSinceOrder = Null
Form_OrderForm.DaysOverdue = Null
End If
End Sub

Thanks alot
 
I meant to add that the bold line is the one highlighted after debugging:o
 

Users who are viewing this thread

Back
Top Bottom