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 / Modules / DAO / VBA / February 2006

Tip: Looking for answers? Try searching our database.

Undo unbound text box value on a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AccessARS - 04 Feb 2006 19:10 GMT
The following is a part of my validation on the BeforeUpdate event procedure
of an unbound text box (Me!PndCk18In1) on my form.  My issue is that although
it captures and prompts the "error" this line (Me!PndCk18In1.Undo '**ISSUE**)
does not seem to work therefore after the prompt it still places that value
in that text box.  I have used this approach on bound text boxes with no
issues so I'm not sure what's going wrong with the unbound text
boxes...please help.

       'Check for Project start time
       If IsNull(Me!In.Value) Then
           Cancel = True
           MsgBox "Missing [TIME: In].  Project has not begun.",
vbExclamation, "TIME ERROR"
           Me!PndCk18In1.Undo '**ISSUE**
           Exit Sub
       End If

Thank you in advance for you assistance.
Marshall Barton - 04 Feb 2006 20:37 GMT
>The following is a part of my validation on the BeforeUpdate event procedure
>of an unbound text box (Me!PndCk18In1) on my form.  My issue is that although
[quoted text clipped - 12 lines]
>            Exit Sub
>        End If

The Undo method (and the OldValue property) only operate on
bound controls.

To capture the value before it is edited, use the control's
Enter event to save its value to a module level variable.
Then you can restore the value from the variable.

Signature

Marsh
MVP [MS Access]

AccessARS - 05 Feb 2006 08:31 GMT
Thank you.

> >The following is a part of my validation on the BeforeUpdate event procedure
> >of an unbound text box (Me!PndCk18In1) on my form.  My issue is that although
[quoted text clipped - 19 lines]
> Enter event to save its value to a module level variable.
> Then you can restore the value from the variable.
 
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.