S
SylvieB
I have a form that has a Close process as follow, when the user select “Wonâ€
or “Lost†from the combo box Reason, AwardAmount and AwardTo are required
fields. They both need to be filled out by the user. If other options other
than “Won†or “Lost†are selected from the Reason combo box, the two fields
are not required. I’m having a hard time to write the code; please help.
Here the code so far:
If Me.Closed = true then
ifNz(Reason.won) = 0 then
msgBox “this is a required fieldâ€, vbInformation, “missing valueâ€
cancel = true
ifNz(Reason.lost) = 0 then
msgBox “this is a required fieldâ€, vbinformation, “missing
valueâ€
cancel = true
ifNz(AwardTo, 0)= 0 then
MsgBox “You must select a name from the listâ€, vbInformation, “Missing valueâ€
Cancel = True
elseIf Nz(AwardAmount, 0)=0 then
MsgBox “you must enter an award amountâ€, “vbinformation, “Missing valueâ€
Cancel = true
Endif
Endif
Thank you
or “Lost†from the combo box Reason, AwardAmount and AwardTo are required
fields. They both need to be filled out by the user. If other options other
than “Won†or “Lost†are selected from the Reason combo box, the two fields
are not required. I’m having a hard time to write the code; please help.
Here the code so far:
If Me.Closed = true then
ifNz(Reason.won) = 0 then
msgBox “this is a required fieldâ€, vbInformation, “missing valueâ€
cancel = true
ifNz(Reason.lost) = 0 then
msgBox “this is a required fieldâ€, vbinformation, “missing
valueâ€
cancel = true
ifNz(AwardTo, 0)= 0 then
MsgBox “You must select a name from the listâ€, vbInformation, “Missing valueâ€
Cancel = True
elseIf Nz(AwardAmount, 0)=0 then
MsgBox “you must enter an award amountâ€, “vbinformation, “Missing valueâ€
Cancel = true
Endif
Endif
Thank you