P
PAULinLAOS
I want to validate data entry in one control based on another. I looked at
some of the other threads in the discussion group but still not understanding.
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" and one for "OUT". If it's a 'Purchase', then
"IN" should be an integer of 1 or more, and OUT must be 0. If it's a sale,
the opposite: OUT should be an integer 1 or more; IN zero. I need to validate
this rule on my form so that data entry people don't accidentally record the
amount sold in the 'IN' control, or record the amount purchased as inventory
OUT. It's a pretty simple concept.
I cannot seem to make work a validation rule in the properties of the "IN"
or "OUT" controls. This is what I have written
Validation Rule for "IN" control: IIf([type]=2,>0,0)
Validation Rule for "OUT" control: IIf([type]=1,>0,0)
I also tried:
Validation Rule for IN: IIf(Forms![inventory]![Combo18]="Purchase",>0,0)
validation Rule for OUT: IIf(Forms![inventory]![Combo18]="Sale",>0,0)
Basically, with these validation rules, it doesn't allow me to put any data
but zero in the fields. It just doesn't work; these rules lock up the IN/OUT
fields so that no data entry can be made. Maybe the syntax is wrong? I am
sure that my logic is correct, but can't express that in the Validation rule
field of properties.
Please help! Can't sleep. (Using Access 2000 format of Access 2003)
some of the other threads in the discussion group but still not understanding.
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" and one for "OUT". If it's a 'Purchase', then
"IN" should be an integer of 1 or more, and OUT must be 0. If it's a sale,
the opposite: OUT should be an integer 1 or more; IN zero. I need to validate
this rule on my form so that data entry people don't accidentally record the
amount sold in the 'IN' control, or record the amount purchased as inventory
OUT. It's a pretty simple concept.
I cannot seem to make work a validation rule in the properties of the "IN"
or "OUT" controls. This is what I have written
Validation Rule for "IN" control: IIf([type]=2,>0,0)
Validation Rule for "OUT" control: IIf([type]=1,>0,0)
I also tried:
Validation Rule for IN: IIf(Forms![inventory]![Combo18]="Purchase",>0,0)
validation Rule for OUT: IIf(Forms![inventory]![Combo18]="Sale",>0,0)
Basically, with these validation rules, it doesn't allow me to put any data
but zero in the fields. It just doesn't work; these rules lock up the IN/OUT
fields so that no data entry can be made. Maybe the syntax is wrong? I am
sure that my logic is correct, but can't express that in the Validation rule
field of properties.
Please help! Can't sleep. (Using Access 2000 format of Access 2003)