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 / June 2007

Tip: Looking for answers? Try searching our database.

How to supress Access messages and using own messages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smiley - 05 Jun 2007 15:55 GMT
Good afternoon,

Would someone tell me how to supressed message from Access but give a
message of my own words. I know there is a setting in Tools --> Options -->
tab Edit/Find, there is a section which headed Confirm. I know I would
unticked those boxes which will not give me the message. But this is only
partial of what I want, I want to give a more meaningful message to users
and not the default message from Acess. Anyway this would be done ?

Many thanks in advance.

Smiley
Klatuu - 05 Jun 2007 16:09 GMT
It depends on which messages your are referring to.  Warning messsages on
file and record operations can be suppressed by setting the options under
Tools, Options, Edit/Find tab.  There are 3 check boxes in the Confirm
section that control these messages.

If it is error messages, then those have to be handled with your own error
handling code.

Signature

Dave Hargis, Microsoft Access MVP

> Good afternoon,
>
[quoted text clipped - 8 lines]
>
> Smiley
Smiley - 05 Jun 2007 17:23 GMT
Hi Dave,

Thank you for the info.

I still would like to know how would I find out which message popped up and
I would 'pop' my own message. For example, if I suppressed the warning
message that 2 records are to be deleted. How do I know (in coding) that the
message is a confirmation of deleting record and not information message,
say record not found.

Another query is where do I find the error codes from MSAccess and handled
it in the coding. for example, if the error is can't find a function. When
this happened, I would like to pop up a message to say that function xxx is
not found rather then error code which means nothing to most user.

Smiley

> It depends on which messages your are referring to.  Warning messsages on
> file and record operations can be suppressed by setting the options under
[quoted text clipped - 17 lines]
>>
>> Smiley
Klatuu - 05 Jun 2007 17:48 GMT
I don't know if there is a printed list of all the possible Access errors.  
What I usually do if I don't know what to expect is to allow the error to
occur in testing, then write my own message.  Here is an example of an error
handling routine.  In this example, I don't care if error 2501 occurs, so I
don't even show it as an error.

PrintReport_Exit:

   On Error Resume Next
   
   Set qdf = Nothing
   Set qdfXl = Nothing
   Set qdfs = Nothing
   Set dbf = Nothing
   
   Exit Sub

PrintReport_Error:

   If Err.Number <> 2501 Then
       MsgBox "Error " & Err.Number & " (" & Err.Description & _
           ") in procedure PrintReport of VBA Document Form_frmBPOReports"
   End If
   GoTo PrintReport_Exit

End Sub

If you want to display your own meaningful message then you use the msgbox
to display it to the user:

FindFieldName_Error:

   If Err.Number = 3265 Then
       MsgBox "Table " & strTblName & " Not Found"
   Else
       MsgBox "Error " & Err.Number & " (" & Err.Description & _
           ") in procedure FindFieldName of Module modUtilities"
   End If
   GoTo FindFieldName_Exit

Signature

Dave Hargis, Microsoft Access MVP

> Hi Dave,
>
[quoted text clipped - 34 lines]
> >>
> >> Smiley
 
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.