Can you post the code and the RowSource of the STATUS combo?
--
Good Luck
BS"D
:
ope, still the same result. the form closes regardless of the fields below?
i thought things were going too well :-(
:
If the STATUS is a combo box, then mybe the combo return the ID and not the
description
So it need to be the ID and not the description, the field that the combo is
bound to. (for example 1)
if [status] =1 and (Nz([bom],0) = 0 or Nz([labourhrs],0) =0) then
MsgBox "Your message"
Cancel = True
end if
--
Good Luck
BS"D
:
i dont know if it makes a difference but i am using a button on the for to
close the form (not the red X button, top right). Also when i enter the code,
run the form and go back to the code; the "end if" has turned yellow
:
hi guys, yes the BOM and LABOURHRS are numeric. i tried the code you supplied
Ofer but when i choose close the form closes regardless of the STATUS, BOM
and LABOURHRS.
The STATUS field is choosen from a drop down in that field. The BOM is a
currency and the labour is a simple number.
:
Hi Dennis,
The form close , doesn't have the option Close.
use the UnLoad event of the form.
if [status] ="engineered" and ([bom] = "0" or [labourhrs] ="0") then
MsgBox("Your message")
Cancel = True
end if
Also, if the fields bom and labourhrs are numeric you need to get rid of the
double quotes
if [status] ="engineered" and (Nz([bom],0) = 0 or Nz([labourhrs],0) =0) then
MsgBox "Your message"
Cancel = True
end if
--
Good Luck
BS"D
:
In the On Close Event of the form put thisc
if [status] ="engineered" and ([bom] = "0" or [labourhrs] ="0") then
MsgBox("Your message")
Cancel = True
end if
:
Hi All, i previously posted a very similar question in the forms group with
little success. I need to code the close form event so that the form does not
close if [status] ="engineered" and ([bom] = "0" or [labourhrs] ="0"). a
messgae will pop up to notify the user that the form is incomplete.
as usual any help greatly appreciated.