Ally
Registered User.
- Local time
- Today, 10:26
- Joined
- Sep 18, 2001
- Messages
- 617
On the "Click" event of my Close command button I have various criteria to ensure that the user has filled in all the relevant fields. I now need to amend one slightly but can't get it right.
If the Outcome field has been filled in, but PAROnDisch hasn't (which is a value of -1) then a message box appears telling them to enter the PAROnDisch. Now there's extra criteria: all the unit numbers are numbers, except for "Ward". If the UnitNo = Ward then it's ok to close, so I tried adding "... And Me.UnitNo <> "Ward", but it doesn't work. It thinks it's ok even when the UnitNo is not a ward.
I have tried various sub "Ifs ... Then GoTo 1 ... GoTo 2" etc but that didn't work either.
This is the code as it is:
Anyone any ideas please?
If the Outcome field has been filled in, but PAROnDisch hasn't (which is a value of -1) then a message box appears telling them to enter the PAROnDisch. Now there's extra criteria: all the unit numbers are numbers, except for "Ward". If the UnitNo = Ward then it's ok to close, so I tried adding "... And Me.UnitNo <> "Ward", but it doesn't work. It thinks it's ok even when the UnitNo is not a ward.
I have tried various sub "Ifs ... Then GoTo 1 ... GoTo 2" etc but that didn't work either.
This is the code as it is:
Code:
ElseIf Not IsNull([Outcome]) And Me.PAROnDisch = -1 And Me.UnitNo <> "Ward" Then
msgbox "No PAR score on discharge entered. Please enter.", vbOKOnly, _
"Missing Information"
DoCmd.GoToControl "PAROnDisch"
Anyone any ideas please?