Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access failure check

Status
Not open for further replies.

AliThePro

Mechanical
Jan 13, 2005
57
When DoCmd.OpenForm with a select statement fails, Access opens a form with nothing on it. Is there any way to check if the OpenForm failed? there is no return value for openform in the documentation. I am using Access 2000
 
Replies continue below

Recommended for you

You might try checking the IsLoaded property of the Form via the Application Forms collection.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
The problem is not finding out if the form is loaded, the problem is: if a record matching my SQL select statement ( an argument to DoCmd.OpenForm) does not exist, and select fails I want to know that so that I can take the appropriate action. How do I know if a record matching the select statement does not exist?

Thanks
 
What do you get when you check the Form.Recordset.EOF and BOF properties in the Form_Load Event?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
If by this check you are trying to see if the table is empty, it is not. It just does not have the record matching the criteria in the select statement. Therefore, the form shows up as a blank form with no controls on it.
 
Not checking the table, but checking the form's recordset. The recordset will contains the results of the SQL statement.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor