Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Microsoft office Access has encountered a problem and needs to close

Status
Not open for further replies.

ernigles

Technical User
Jan 15, 2009
31
ES
Hi, since i have added a few lines of code to my database from the VBE, i have the window:

"Microsoft Office Access has encountered a problem and needs to close. We are sorry for the inconvenience"

when i open the database. The code lines are:


Code:
Private Sub Form_Open(Cancel As Integer)
If IsNull(whereCondition) = False Then
    If whereCondition = "" Then
        Me.FilterOn = False
    End If
Else
    Me.FilterOn = False
End If
End Sub

These lines have to be added because in 2007 version of Access, the form applies rarely a random (?) filter when no filter is applied from the combobox for doing it (when this happens, whereCondition -String type variable- is built with the identity number of the records shown separated with a comma, so that variable stops being a null variable and a 0 lenght string).

Does anybody know what is wrong in this implementation or in the DB?

Thanks in advance for any help.
 
Compacting and reparing the DB has solved the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top