Solved

Property not found error in BeforeUpdate event

Posted on 2009-07-07
5
730 Views
Last Modified: 2013-11-28
I am using Access 2007:

I am using Access 2007:

My problem has to do with BeforeUpdate Event associated with a textbox on a datasheet. following the Cancel = True code, the application brings up a dialog of Error 3270 Property not found.  It is not possible to trap for the error.  I even switched my setting in VBA to Break on All errors and it still will not stop to tell me where exactly the error is coming from.  Just wondering if anyone has any ideas.  My code (in the BeforeUpdate event of the text box) follows.


Dim Msg, Style, Title, Help, MyString, Response
    On Error GoTo Error_Trap
    If Me.txtNetWt = "" Then  'Continue on.  Do nothing
    Else
    
       
        Msg = "You are about to change a value that affects the Weight fields.  If you continue Qty and NetWt and GrosWT fields will be blanke." _
       & vbCrLf _
       & vbCrLf _
       & "Is this what you want?"
        Style = vbYesNo + vbDefaultButton2
        Title = "Question"
        Response = MsgBox(Msg, Style, Title)
        If Response = vbYes Then
         'continue on
        Else
            Me.txtSize.Undo
            Cancel = True
        End If
    End If
    
Exit_Error:
    Exit Sub
    
Error_Trap:
       
    If Err.Number = 3270 Then     'Property not found
       Resume Next
    Else
      MsgBox "Error #" & Err.Number & ": " & Err.Description & ". Wdy code. See brnRetrieve_Click "
      Resume Exit_Error
    End If

Open in new window

0
Comment
Question by:WoodrowA
[X]
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
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:thenelson
ID: 24799776
Single step though the code to see what is creating the error.
0
 

Author Comment

by:WoodrowA
ID: 24799844
Thank you for responding.
As I tried to communicate in my original post, single stepping does not work.  Apparently the error happens after the end sub of the BeforeUpdate Event and Access gives no indication as to why or where or how.  Single stepping does not work.
0
 
LVL 39

Expert Comment

by:thenelson
ID: 24815585
Try remarking out the line:
On Error GoTo Error_Trap
and running the code.

If that doesn't display the error try decompiling/recompiling:
CREATE A BACKUP OF THE CORRUPT DATABASE. (Just in case)

decompile: in run: msaccess "dbPathName.mdb" /decompile
   Compact/repair:  in run: msaccess "dbPathName.mdb" /compact
   compile: in VB editor: debug> compile
   Compact/repair
   http://www.granite.ab.ca/access/decompile.htm

BTW: you can replace    
If Me.txtNetWt = "" Then  'Continue on.  Do nothing
    Else
...
End If
With
If Me.txtNetWt = "" Then  Exit Sub
It would be easier to follow also.
I would also change it to:
If Len(Me.txtNetWt & "") = 0 Then  Exit Sub
A few microseconds faster and traps Nulls also.
0
 

Accepted Solution

by:
WoodrowA earned 0 total points
ID: 24819606
Nelson,
I appreciate you responding.  I have tried your suggestions but the error remains.  I believe I have found a legitmate bug in Access 2007.  This error manifests itself when the form in question is in datasheet mode, and may be more likely to happen of the control is a text box.  When I run the same code in form view there is not problem.
I am aware of at least one other user who has experienced the same problem and it was delineated in UtterAccess.com.  However, no solution was found.  
0
 
LVL 39

Assisted Solution

by:thenelson
thenelson earned 500 total points
ID: 24824423
Perhaps as a work around, Youcan use the after update event and me.undo.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access creating new db - relationships 8 56
MS Access - Autofill field with item description 6 53
Return Data From Website in Access 6 56
Export individual report to pdf 2 40
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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