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

Tip: Looking for answers? Try searching our database.

Code Notes field NOT to accept (save) notes that contain no data.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam - 26 Jul 2005 06:07 GMT
Hello

I have a subform on my main form which holds notes for each customer. I want
to set up the notes section so that it will not save it there is no input.

Can anyone help???
John Vinson - 26 Jul 2005 07:27 GMT
>Hello
>
>I have a subform on my main form which holds notes for each customer. I want
>to set up the notes section so that it will not save it there is no input.
>
>Can anyone help???

Open the form you're using as the subform in design view. View the
form's Properties; on the Events tab select the BeforeUpdate event,
and click the ... icon by it. Choose Code Builder. Edit the two lines
Access gives you by adding code between them:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Len(Me!Notes & "") = 0 Then ' did user leave notes blank?
  Cancel = True ' if so, cancel the update
  Me.Undo       ' and erase the current subform record
End If
End Sub

                 John W. Vinson[MVP]    
 
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.