Senin, 05 Juni 2017

Re: [MS_AccessPros] Re: Error 2467 When Changing to Design View

 

how about using
On Error Resume Next

also, more efficient to use With
'~~~~~~~~~~~~~~~~~~~~~~~
with Me.cboSite 
If Not IsNull (.value) Then
    'if data type not a number, use delimiters around .Value
     .DefaultValue = .value 'this will work if DefaultValue poperty already exists
  End If
end with 'Me.cboSite
'~~~~~~~~~~~~~~~~~~~~~~~

respectfully,
crystal


http://www.MsAccessGurus.com
 
~ have an awesome day ~

On 6/5/2017 12:03 PM, wrmosca@comcast.net [MS_Access_Professionals] wrote:
David - Forms that have had a lot of design changes tend to bloat. That leads to corruption which could be what is happening here.

Save the form as text using SaveAsText() in the Immediate window.
Delete the existing form.
Compact the database
Import the form using LoadFromText()

Regards,
Bill Mosca, Founder - MS_Access_Professionals
My nothing-to-do-with-Access blog


---In MS_Access_Professionals@yahoogroups.com, <david.pratt@outlook.com> wrote :

I have a form that includes a combo cboSite attached to field SiteID.  In order to get the value of SiteID to default to the same as the the previous record and speed data entry I have the following code in the form After_Update Event:
  If Not IsNull (Me.cboSite) Then
     Me.cboSite.DefaultValue = me.cboSite.value
  End If

When in Form View the code works just fine and does what I need.  However, every time I try to go from Form View to Design View it throws error code 2467 with message:
"The expression you entered refers to an object that is closed or doesn't exist."  When it does this, the first line of the IF statement is highlighted.


 

__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar