G
Guest
I want to validate data entry in one control based on another. It's an
inventory database. In one control, I choose from a combo box called
[Combo18] whether the record is a 'Sale' or a 'Purchase'. 'Sale'/'Purchase'
is stored in the control [type] as a number, Sale=1 and Purchase=2. I also
have one field/control for [IN], which is a number/amount for how many items
were purchased. So, the rule is that if the combo box shows 'Purchase', then
[IN] should be an integer of 1 or more. If it's a sale, then [IN] is zero.
I've tried, unsuccessfully, at writing a validation rule in the properties
of the [IN] text box on the form as follows:
IIf([type]=2,>0,0)
I also tried:
IIf(Forms![inventory]![Combo18]="Purchase",>0,0)
Neither of these work. Any idea of how to write this simple IF/THEN
statement to validate my data entry?
inventory database. In one control, I choose from a combo box called
[Combo18] whether the record is a 'Sale' or a 'Purchase'. 'Sale'/'Purchase'
is stored in the control [type] as a number, Sale=1 and Purchase=2. I also
have one field/control for [IN], which is a number/amount for how many items
were purchased. So, the rule is that if the combo box shows 'Purchase', then
[IN] should be an integer of 1 or more. If it's a sale, then [IN] is zero.
I've tried, unsuccessfully, at writing a validation rule in the properties
of the [IN] text box on the form as follows:
IIf([type]=2,>0,0)
I also tried:
IIf(Forms![inventory]![Combo18]="Purchase",>0,0)
Neither of these work. Any idea of how to write this simple IF/THEN
statement to validate my data entry?