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 / August 2005

Tip: Looking for answers? Try searching our database.

Check box Before Update

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Samantha - 29 Aug 2005 21:56 GMT
I am in the process of migrating the backend to MySQL and testing the
frontend with MsAccess 2000.  I need to check that all necessary data fields
are entered before I make the update on a subform by using the BeforeUpdate
event on a checkbox (Checkbox1). But the BeforeUpdate event still updates the
data even if I use undo and exit sub on the code.
This is what I have so far:

If Me![Checkbox1].Value <= -1 Then
   If isnull(text1) then
    Me![Checkbox1].Undo
       Exit Sub
   End If
End If
Any help is very much appreciated. thank you.
George Nicholson - 30 Aug 2005 01:07 GMT
BeforeUpdate event has a Cancel argument for this purpose. Add the line
   Cancel = True
to the appropriate place in your code and the Update won't happen.

HTH,
Signature

George Nicholson

Remove 'Junk' from return address.

>I am in the process of migrating the backend to MySQL and testing the
> frontend with MsAccess 2000.  I need to check that all necessary data
[quoted text clipped - 13 lines]
> End If
> Any help is very much appreciated. thank you.
Samantha - 30 Aug 2005 18:19 GMT
Works like a charm. Thanks Geroge.

> BeforeUpdate event has a Cancel argument for this purpose. Add the line
>     Cancel = True
[quoted text clipped - 18 lines]
> > End If
> > Any help is very much appreciated. thank you.
 
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.