Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Compile Error: Method or data member not found texbox.undo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jordan C. Schroeder - 20 May 2008 14:27 GMT
Hello Experts,

I am trying to compile my database application, but I seem to be running
into an error on one of my forms in the BeforeUpdate event.  Here is the code
for my validation:

Private Sub Customer_BeforeUpdate(Cancel As Integer)
If (Customer.Value & vbNullString = vbNullString) Then
  MsgBox "Customer is required!", vbOKOnly
 
 Cancel = True
 
 Customer.Undo
Else
End If
End Sub

When I compile it highlights the Customer.Undo line and says Method or data
member not found.  Kind of odd since I am using the same statement on another
form which does not produce the error.  Any suggestions would be greatly
appreciated.

Thanks!
Klatuu - 20 May 2008 15:29 GMT
You should always qualify your object names with Me. or Me! or if the objects
are not related to the current form or report, then full name of the external
object reference  Forms!NameOfOtherForm!

I would do it like this:

Private Sub Customer_BeforeUpdate(Cancel As Integer)
   If  Me.Customer & vbNullString = vbNullString Then
       MsgBox "Customer is required!", vbOKOnly
       Cancel = True
       Me.Customer.Undo
   End If
End Sub

Signature

Dave Hargis, Microsoft Access MVP

> Hello Experts,
>
[quoted text clipped - 19 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.