473,948 Members | 1,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

turn off warning

ken
Hi,
How do you turn of the warning that you get "Can't go to specified
record" when you use custom navication buttons which have the following
code:DoCmd.GoTo Record , , acPrevious or DoCmd.GoToRecor d , , acNext

Thanks

Nov 13 '05 #1
4 6176
docmd.SetWarnin gs False
'do your thing
docmd.SetWarnin gs True

but remember to turn the warnings back on in your error handling code,
because otherwise all messages will be suppressed.

Nov 13 '05 #2
ken
It still does that. I think because its not a warning, but an error
that I'm getting.
Here is my code
On Error GoTo Err_BUT_PREV_RE C_Click
DoCmd.SetWarnin gs False
DoCmd.GoToRecor d , , acPrevious
DoCmd.SetWarnin gs True

Exit_BUT_PREV_R EC_Click:
Exit Sub

Err_BUT_PREV_RE C_Click:
MsgBox Err.Description
Resume Exit_BUT_PREV_R EC_Click

End Sub

After the second docmd that tells the form to go back one...it goes to
the err handler.

There is no error number though...just a message "Can't go to specified
record" with an ok button.

Nov 13 '05 #3
According to help:

'You can use this action to prevent modal warnings and message boxes from
stopping the macro. However, error messages are always displayed.'

Mostly I've used SetWarnings False to disable, er, warnings before deleting
records and similar. In other words to hide the 'are you sure' type
messages. Yours isn't an 'are you sure' type message, more a sort of 'enough
already, there ain't no more goddam records, ok buddy?' type message.

Anyway, if you've gone to the trouble of writing custom navigation buttons,
you should catch the no-previous-record and no-next-record cases for the
first and last records, otherwise you've got even less functionality than
the built in access nav buttons.

Oh, and by the way, although SetWarnings probably isn't going to work here,
if you do use it in the future, remember to put a SetWarnings True in your
exit sub, otherwise if the error occurs after the false but before the true
then warnings will still be off.

Sam

"ken" <ge****@gmail.c om> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
It still does that. I think because its not a warning, but an error
that I'm getting.
Here is my code
On Error GoTo Err_BUT_PREV_RE C_Click
DoCmd.SetWarnin gs False
DoCmd.GoToRecor d , , acPrevious
DoCmd.SetWarnin gs True

Exit_BUT_PREV_R EC_Click:
Exit Sub

Err_BUT_PREV_RE C_Click:
MsgBox Err.Description
Resume Exit_BUT_PREV_R EC_Click

End Sub

After the second docmd that tells the form to go back one...it goes to
the err handler.

There is no error number though...just a message "Can't go to specified
record" with an ok button.

Nov 13 '05 #4
ken wrote:
It still does that. I think because its not a warning, but an error
that I'm getting.
Here is my code
On Error GoTo Err_BUT_PREV_RE C_Click
DoCmd.SetWarnin gs False
DoCmd.GoToRecor d , , acPrevious
DoCmd.SetWarnin gs True

Exit_BUT_PREV_R EC_Click:
Exit Sub

Err_BUT_PREV_RE C_Click:
MsgBox Err.Description
Resume Exit_BUT_PREV_R EC_Click

End Sub

After the second docmd that tells the form to go back one...it goes to
the err handler.

There is no error number though...just a message "Can't go to specified
record" with an ok button.


Why don't you present the err number? Ex:
MsgBox Err.Number & " " & Err.Description

Now you can trap for it. For example
Err_BUT_PREV_RE C_Click:
If err.Number <> 2105 then MsgBox Err.Description
Resume Exit_BUT_PREV_R EC_Click
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7464
by: joes | last post by:
Hello I am using tomcat 3.3.1 for an intranet application with other third party software. Unfortunately I have to remove from the web.xml the web-app valiadtion, because of the old third party software. The¨follow up is now that tomcat during every startup is claiming about that the web.xml is not "well-formed". However I would like to turn off this validation, but I don't know where it can be configured. Maybe it can be reached by...
1
1644
by: Bill Sun | last post by:
Hi, Who can tell me how to turn off the annoying link warning, like this: Xxxx.lib(read_dose.obj) : warning LNK4204: '......xxxx\vc70.pdb' is missing debugging information for referencing module; linking object as if no debug info Thanks advanced, Bill
2
3344
by: Bob | last post by:
In the following code, when the DELETE line is executed I get a dialog asking if I want to delete or to cancel. How do I turn it off? Also when the first CLOSE line is executed, the application so to sleep. Dim strTabName = Path.GetFileNameWithoutExtension(strSourceWorkBookName) Dim wbSOURCE As Excel.Workbook Dim wbTARGET As Excel.Workbook With appExcel wbSOURCE = .Workbooks.Open(strSourceWorkBookName) wbTARGET =...
1
3807
by: Maxwell2006 | last post by:
Hi, How can I turn off the compiler warnings in some specific spots in the code? I don't want to turn off warnings for all project. I remember we had PRAGMA feature in C++. Do we have the similar thing in C#? Thank you, Max
2
2519
by: chris.fairles | last post by:
So I took a look at assert.h because I knew it uses -DNDEBUG to turn off its assert statements but it does some funky stuff that I don't quite understand. I made my own def's something like: #ifdef DEBUG_LEVEL_1 #define iprint(expr) printf(#expr " = %d\n", expr) #else #define iprint(expr) #endif
4
23566
by: no_spam_for_gman | last post by:
Hi, I can turn off autocommit within the command window but I cannot figure out how to turn it off when you are in the IBM DB2 Command Line Processor. Does anybody knows how? By the way I mean when you are logged on and the prompt is: db2 => Here's an example how I do it from Command Window (option is c):
24
7097
by: marcwentink | last post by:
Is there a way to turn off depreacted warnings in Visual Studio 2005, Professional Edition? I've got this VB project ported from version 2003 to 2005, I am a bit cautious to already changing the code that much that it could not be ported back, but I got a few hundred warnings saying things like: 'Public Function Add(parameterName As String, value As Object) As System.Data.SqlClient.SqlParameter' is obsolete: 'Add(String parameterName,...
2
708
by: brino | last post by:
hi all ! i am using a hyperlink to open another database from the database that is being used by my client. when the client does this it brings up a warning message about opening hyperlinks saying that they could be dangerous etc. etc. how can i stop this message coming up every time the hyperlink is clicked.
3
5750
LacrosseB0ss
by: LacrosseB0ss | last post by:
Quick question: is there a way to programmatically turn off the warning message for macros in Excel? (Macros can be harmful ... enable/disable) The reason for the question is on our intranet page we have a link to an HR document a lot of people use. However, this document runs macros. We would like to, if possible, have the message NOT be displayed. It has been confusing some users as they don't know it's an Excel doc. Nor do they really know...
0
9987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11579
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11353
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10694
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9897
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8256
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6337
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.