If statements in a function?
Hi
I'm developing the purchasing database. I am working on processing input details. The opening form is taken from an employee details table and has the standard fields such as Employee number, first name , second name etc. I also have checkboxes representing the benefits an employee can have ie Car, Carpark, Phone and Fuel. I thought that depending on the combination of tickboxes ticked, unticked, I could hold a value in a variable (eg x) that will denote that combination for each employee. I could then use this value to determine what queries need to be ran when viewing details for the employee. The function I have coded in order to calculate x is rejected because of arguments eg
Function getx(vcar As Variant, vphone As Variant, vCarpark As Integer, vFuel As Variant) As Integer
If vcar = -1 And vphone = 0 And vCarpark = 0 And vFuel = 0 Then
X = 1
Else
X = 0
End If
etc
Is it possible to use a function with if statements?
Cheers
Tony
__________________
Cheers
Tony
|