Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Run -time error '2771': The bound or unbound object frame you tried to edit doesn't contain an OLE object.

Posted on 2004-10-21
Medium Priority
Last Modified: 2010-08-05
I have a Access form that has several combobox lookup controls are used to create the SQL statement to apply filters to the querry.  This worked fine if the filter found matching records or not.  My problems started when I attempted to add a activex date control.  The form and code works fine as long as the applied filter finds matching records.  If no matching records are found, and I attempt to change the axtiveX control of my date ranges for the querry filter, I recive the following message.

Run -time error '2771':
The bound or unbound object frame you tried to edit doesn't contain an OLE object.

It breaks on the following code.

If atxStartDate.Value > atxEndDate.Value Then
    atxEndDate.Value = atxStartDate.Value
    txtEndDate = VBA.FormatDateTime(atxEndDate.Value, vbShortDate)
End If

The controls are not bound to the record, they are only used to write the SQL code to apply to the filter of the querry.

Any Ideas?
Question by:RobertStamm
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Expert Comment

ID: 12374019
You could handle the error and keep going:

On Error GoTo ErrorHandler

     Exit Sub

       Select Case Err.Number
             Case 2771
                   Resume Next
             Case Else
                    MsgBox "Error number: " & Err.Number & " - " & Err.Description
       End Select
Resume Exit_Here

Expert Comment

ID: 12374614
Hi Robert,
Are you trying to use the filter to limit the data displayed in your form?

Author Comment

ID: 12375574
Yes, I'm trying to use the filter to limit the records displayed on my form?  I have several comboboxes that create a SQL statement to show matching records in a final combobox. This works fine.  The issue I'm having is when I apply the same information to the form filter.  All works well until send a filter that produces no results.  At that time when I try to expand the date range I recieve the above message.  I could try to ignore the message but I haven't tried that yet.

PS. I'm a self-taught programmer and some of these issues are new to me.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 41

Expert Comment

ID: 12375658
You could check to see if the form is currently showing no records:
If Me.CurrentRecord=0 Then

This only works though if the form does not allow additions.

Accepted Solution

Gal_atea earned 2000 total points
ID: 12375689
A friend of mine wrote a form that has similar functions for filtering the form. He checked after setting the filter and if no records were returned popped up a message box to warn the user, then turned the filter off:

Private Sub CmdUpdateFilter_Click()
    'Re-set filter
    UpdateFilterHM 'Call the function to build the filter
    'If no records match current filter
    If Me.Recordset.EOF = True Then
        NotFound = "No records Found Matching Your Criteria"
        MsgBox (NotFound)
        Me.FilterOn = False
    End If
End Sub

Author Comment

ID: 12375741
These comments and suggestions look good.  I'll try them and award points later.

Expert Comment

ID: 12378147
Thanks for the grade Robert, glad I could help!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question