|
-
Jun 17th, 2005, 09:04 AM
#1
Thread Starter
Member
Display Alerts in Access
Hey,
Is there a method similar to ExcelApplication.displayalerts = False to suppress any messages created in Access. When I run a macro in Access VBA, it complains about a few records not being complete, and I do want to display this message.
Thanks for your help,
VO
Last edited by ovlia1286; Jun 23rd, 2005 at 11:06 AM.
-
Jun 17th, 2005, 09:21 AM
#2
Re: Display Alerts in Access
i think you will need to get the information you want to display and use a message box
pete
-
Jun 17th, 2005, 09:35 AM
#3
Thread Starter
Member
Re: Display Alerts in Access
No, I don't want it to display any messages/alerts...
Vince
-
Jun 17th, 2005, 10:15 AM
#4
Re: Display Alerts in Access
and I do want to display this message.
sorry i got it wrong
just put in error handling with resume next
pete
-
Jun 17th, 2005, 10:41 AM
#5
Thread Starter
Member
Re: Display Alerts in Access
Wow, I should of tried that... thanks for your help .
VO
-
Jun 17th, 2005, 10:55 AM
#6
Thread Starter
Member
Re: Display Alerts in Access
It didn't work... when i step through the code, the alert occurs before the code goes to the error handle. The alert is the following: "Microsoft is unable to apend all the data to the table. Do you want to proceed?"
-
Jun 17th, 2005, 11:03 AM
#7
Re: Display Alerts in Access
before that position, put in a line
on error goto errorhandle
at the end of the sub, on the line before End Sub add a few lines like
VB Code:
exit sub ' so normally code will not go past
errorhandle: ' label to go to
if err.number = xxxx then resume next , where xxxx is the number for the
'error you are getting and resume next mean go back to the line after the error
' here you would have conditions for other errors
End Sub
to go back to other errors not being processed by this error handler put
on error goto 0
pete
-
Jun 17th, 2005, 12:59 PM
#8
Thread Starter
Member
Re: Display Alerts in Access
I put an "on error goto errorhandle" line in my code before the error occurs. However, it still give me the same problem. The alert message is displayed BEFORE the program goes to the error handler. Is there no way to turn alerts off in Access?
VO
-
Jun 18th, 2005, 08:04 AM
#9
Frenzied Member
Re: Display Alerts in Access
There's an choice in the Options menu on the toolbar of Access to turn on/off warnings. FWIW, I think that in some cases that overrides normal error handling.
The problem with turming off warnings is that will affect your whole app. It's probably possible to turn it off & back on through menubar commands, but I don't know the code for that offhand.
But do you really want to turn it off? It would be a lot better to handle the error in some way.
Tengo mas preguntas que contestas
-
Jun 18th, 2005, 09:38 AM
#10
Re: Display Alerts in Access
Since this is a Insert or AddNew record error from the data being incomplete or incorrect, I dont think you can turn off that
level of an error. Its best to fix the error.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 23rd, 2005, 11:06 AM
#11
Thread Starter
Member
Re: Display Alerts in Access
I agree that the error should be fixed. However, just for everyone's information, DoCmd.SetWarnings will enable or disable warnings in Access...
Thanks for everyone's help,
VO
-
Jun 23rd, 2005, 11:23 AM
#12
Re: Display Alerts in Access
It can also be accessed from the app object.
VB Code:
Application.DisplayAlerts = False 'Turn them off
'Do something that will invoke an error message
Application.DisplayAlerts = True 'Turn it back on.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|