no current record

D

deb

After this validation is fired I get msg... No current record.
How can I fix this?

Private Sub Form_Unload(Cancel As Integer)

'***********Validate if = TBD *****************
Dim msg As String
Dim ans As String
'If Sent/Received Date is assigned and TLNo is TBD then delete dates or
change TLNo.
If ((Not
IsNull(Me.f000Deliverable.Form.fTLNo.Form.f001WithinS.Form.WSDateReceive)) Or
_
(Not
IsNull(Me.f000Deliverable.Form.fTLNo.Form.f002SCustomer.Form.SCDateSent)) Or _
(Not
IsNull(Me.f000Deliverable.Form.fTLNo.Form.f003CustomerS.Form.CSDateReceive)))
And (Me.f000Deliverable.Form.fTLNo.Form.TLNo = "TBD") Then
msg = "TL Number cannot be ""TBD"" if Sent or Received dates are
assigned." _
& vbCr & vbCr & "Select Ok to change TL Number" _
& vbCr & vbCr & "or Cancel to remove ALL Sent and Received Dates."
ans = MsgBox(msg, vbOKCancel, "Attention")
If ans = vbOK Then
MsgBox "Please, enter correct TL Number."
Cancel = True
Me.f000Deliverable.Form.fTLNo.Form.TLNo.SetFocus
' Exit Sub
Else
MsgBox "If assigned, the Sent and Received Dates" _
& vbCr & vbCr & " on ALL TABS will be removed."
Me.f000Deliverable.Form.fTLNo.Form.f001WithinS.Form.WSDateReceive =
Null
Me.f000Deliverable.Form.fTLNo.Form.f002SCustomer.Form.SCDateSent =
Null
Me.f000Deliverable.Form.fTLNo.Form.f003CustomerS.Form.CSDateReceive
= Null
Cancel = True
' Exit Sub
End If
End If
 

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

Similar Threads


Top