Is null and Else

  • Thread starter maxjake via AccessMonster.com
  • Start date
M

maxjake via AccessMonster.com

Hi All

This code works great, BUT i want the form to close or be read only if the
[Job Completes] equals null

Do I use else??


Private Sub Form_Unload(Cancel As Integer)
If IsNull(Me.[Passed To]) And Not IsNull(Me.[JOB COMPLETES]) Then
MsgBox "Who have the works been Passed To?", vbExclamation, "Invalid
Operation "
Cancel = True
End If
End Sub

Thanks
Max
 
A

Allen Browne

Move the code to the BeforeUpdate event procedure of the form.

By the time the from's Unload event fires: the record has been already
saved.
 
S

smart

Allen Browne said:
Move the code to the BeforeUpdate event procedure of the form.

By the time the from's Unload event fires: the record has been already
saved.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

maxjake via AccessMonster.com said:
Hi All

This code works great, BUT i want the form to close or be read only if
the
[Job Completes] equals null

Do I use else??


Private Sub Form_Unload(Cancel As Integer)
If IsNull(Me.[Passed To]) And Not IsNull(Me.[JOB COMPLETES]) Then
MsgBox "Who have the works been Passed To?", vbExclamation, "Invalid
Operation "
Cancel = True
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top