Connecting Tech Pros Worldwide Help | Site Map

Report/Form event "On No Date"

S. van Beek
Guest
 
Posts: n/a
#1: Jan 3 '06
Dear reader,



First of all a happy new year.



In Report event there is the "On No Date" event but in a Form this event is
not available.


Which event is the trigger in a Form if there is no data available by
changing the record selection criteria in the Form.



Thanks for any help.



Kind regards,

Simon van Beek







Allen Browne
Guest
 
Posts: n/a
#2: Jan 4 '06

re: Report/Form event "On No Date"


On No Date sounds rather desperate? :-)

If you are trying to simulate the report's No Data event in a form, cancel
its Open event when the RecordCount is none, or if NewRecord is True:

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Cancel = True
MsgBox "Nobody home."
End If
End Sub

Hopefully you are not opening this form in Data Entry mode.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"S. van Beek" <S.v.Beek@HCCnet.nl> wrote in message
news:43baf133$0$811$3a628fcd@textreader.nntp.hccne t.nl...[color=blue]
>
> In Report event there is the "On No Date" event but in a Form this event
> is
> not available.
>
> Which event is the trigger in a Form if there is no data available by
> changing the record selection criteria in the Form.[/color]


Closed Thread


Similar Microsoft Access / VBA bytes