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

Tip: Looking for answers? Try searching our database.

Error Message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kyle Friesen - 26 Jan 2005 21:20 GMT
Hello,
I have a command button on a form that is linked to a macro that runs queries, saves the data to the form's table, etc. The table has required input fields and so when the command button is selected without all fields entered an "Action Failed" error message appears with "Halt", Macro could not be executed, etc. I have code that scans the required fields on the form through the before_update module. Question: How do I get rid of the Halt "Action Failed" error message so that my MsgBoxes are the only error messages that appear?? It seems I have two different error messages for the same error. Thanks.
Ken Snell [MVP] - 26 Jan 2005 21:45 GMT
In order to do what you seek, you'd need to validate that all required
values have been entered. If you wish to do this within that macro, you'd
need to add 2 steps as the first steps in the macro that has a condition to
check that all values have been entered:

Condition:  IsNull(Forms!Formname!Controlname1) Or
IsNull(Forms!Formname!Controlname2) Or IsNull(Forms!Formname!Controlname3)
   Action:  MsgBox
       Message:  You need to provide values for all fields!

Condition:  . . .
   Action:  StopMacro

Signature

       Ken Snell
<MS ACCESS MVP>

> Hello,
> I have a command button on a form that is linked to a macro that runs
[quoted text clipped - 6 lines]
> messages that appear?? It seems I have two different error messages for
> the same error. Thanks.
Kyle Friesen - 27 Jan 2005 00:54 GMT
thanks. can you point me in teh right direction as to where I put these conditions...thanks, I am just learning.
Ken Snell [MVP] - 27 Jan 2005 01:57 GMT
When you open the macro in design view, if you don't see a column named
Condition, then click on View menu and select Condition from the list. Type
the expression that I provided into that box.

Note that the second line has three dots in it. Type them into the Condition
box for the second line:
   ...

This is how you have multiple steps be run for a single Condition... the
three dots are a continuation.

Signature

       Ken Snell
<MS ACCESS MVP>

> thanks. can you point me in teh right direction as to where I put these
> conditions...thanks, I am just learning.
Kyle Friesen - 27 Jan 2005 18:43 GMT
Great, 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.