nikomou
12-05-2007, 06:00 PM
Hey
I'm trying to reduce the amount of duplicate code in my program. I have a global module with the code:
Public Sub workDiscount()
'Discounts
If Form1.radStu.Checked = True Then
dblDiscount = ((screencost / 100) * 15)
End If
If Form1.radOAP.Checked = True Then
dblDiscount = ((screencost / 100) * 20)
End If
If Form1.radNoDiscount.Checked = True Then
dblDiscount = 0
End If
and to call it in the main form, i just put use
workDiscount(). this works great if i only call it once! put i would need to use it a few times within the program!
THanks for your help/
I'm trying to reduce the amount of duplicate code in my program. I have a global module with the code:
Public Sub workDiscount()
'Discounts
If Form1.radStu.Checked = True Then
dblDiscount = ((screencost / 100) * 15)
End If
If Form1.radOAP.Checked = True Then
dblDiscount = ((screencost / 100) * 20)
End If
If Form1.radNoDiscount.Checked = True Then
dblDiscount = 0
End If
and to call it in the main form, i just put use
workDiscount(). this works great if i only call it once! put i would need to use it a few times within the program!
THanks for your help/