Error /Dirty read on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have developed a form based on a query that prompts users for criteria.
If no data is available for a particular criteria an un enabled / blank
version of the form opens up.
How can I slot in a Msg box tha says no "No Data for this selection) and the
closes the form without showing a blank version if no data exist.
Many thanks
Dapo
 
dee said:
I have developed a form based on a query that prompts users for criteria.
If no data is available for a particular criteria an un enabled / blank
version of the form opens up.
How can I slot in a Msg box tha says no "No Data for this selection) and the
closes the form without showing a blank version if no data exist.


Use the form's Load event to check for no data:

If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No data for this selection"
DoCmd.Close acForm, Me.Name
End If
 
Hi Marshal
Thanks a million!
It works to solve the error read problem.But because I have already set the
form's property [Allow additions] to "No"
It comes up witis error message: The Object doesn't contain the Automation
object 'stLinkCriteria' when I try save changes and close the form.
Pls advise

Many thanks
Dapo
 
Back
Top