Article on showing Windows style error on MS Access Form

I am building an application with several forms. In the BeforeUpdate event 
for the form, I will run some data validation routines.

If there is an error, I would like to display an error control next to each 
field containing an error (the exclamation point). The user can then hover 
over the error control and get an explanation of the error. This is similar 
to how a normal windows application works.

Some time ago, I can recall seeing an article that described the exact 
technique that I want to use, but I can't find it now. Could someone please 
point me to the article?

Many thanks!
0
Utf
10/22/2007 10:51:01 AM
access.forms 6864 articles. 2 followers. Follow

5 Replies
622 Views

Similar Articles

[PageSpeed] 58

Some additional information. I would like to use something similar to an 
error provider in Visual Studio.

"Flavelle Ballem" wrote:

> I am building an application with several forms. In the BeforeUpdate event 
> for the form, I will run some data validation routines.
> 
> If there is an error, I would like to display an error control next to each 
> field containing an error (the exclamation point). The user can then hover 
> over the error control and get an explanation of the error. This is similar 
> to how a normal windows application works.
> 
> Some time ago, I can recall seeing an article that described the exact 
> technique that I want to use, but I can't find it now. Could someone please 
> point me to the article?
> 
> Many thanks!
0
Utf
10/22/2007 11:46:00 PM
Hello Flavelle,

You would properly put the corrected statement in the form's BeforeUpdate 
event, and set the event procedure's Cancel argument to True if your 
requirements are not met.  That will keep the record from being saved. The 
following is a sample code that for your reference. 

Private Sub Form_BeforeUpdate(Cancel As Integer)
    Dim strMsg As String

    If Not IsNull(Me.C) Then
        If Me.B <> Me.C And IsNull(Me.A) Then
            Cancel = True
            strMsg  = strMsg & "You must supply A if B is not C." & vbCrLf
        End If
    End If

    If IsNull(Me.SomeField) Then
        Cancel = True
        strMsg = strMsg & "SomeField is required." & vbCrLf
    End If

    If Cancel Then
        strMsg = strMsg & vbCrLf & "Correct the entry, or press <Esc> to 
undo."
        MsgBox strMsg, vbExclamation, "Invalid Data"
    End If
End Sub

As for exclamation point before a field and explanation of the error, I 
didn't find the exact sample. However, you might add some hidden image, 
label and textbox controls and change the Visible property to true in the 
event sub.


More related information:

Part 5 of "Keeping Your Information Accurate" in Access 2003 and Access 
2002: "Using Validation Rules to Restrict Data"
http://support.microsoft.com/kb/311172/en-us

If you have any further questions or concerns, please feel free to let's 
know. Thanks. 

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications 
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

0
petery
10/23/2007 9:50:49 AM
Peter:

Thanks - and I'm okay with what you wrote. A follow-up - any idea where I 
can get the image that is used in the Error Provider?

"Flavelle Ballem" wrote:

> I am building an application with several forms. In the BeforeUpdate event 
> for the form, I will run some data validation routines.
> 
> If there is an error, I would like to display an error control next to each 
> field containing an error (the exclamation point). The user can then hover 
> over the error control and get an explanation of the error. This is similar 
> to how a normal windows application works.
> 
> Some time ago, I can recall seeing an article that described the exact 
> technique that I want to use, but I can't find it now. Could someone please 
> point me to the article?
> 
> Many thanks!
0
Utf
10/23/2007 4:04:04 PM
Hello Flavelle,

I think you could use the image control and get the image you want from 
Web. For example, you could search free icon gallery to get some 
references. 

Please let's know if you have any further comments on the issue. Thank you. 

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

======================================================
PLEASE NOTE:

This posting is provided "AS IS" with no warranties, and confers no rights. 
======================================================




0
petery
10/25/2007 5:39:22 AM
Hello Flavelle,

I'm still interested in this issue.  If you have any comments or questions, 
please feel free to let's know. We look forward to hearing from you. 

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

======================================================
PLEASE NOTE:

This posting is provided "AS IS" with no warranties, and confers no rights. 
======================================================

0
petery
10/29/2007 8:29:51 AM
Reply:

Similar Artilces:

Error number: 0x800ccc0e
Why am I getting this right after installing Outlook 2000? It was a gift. I have had no success trying to get info from the knowledge base. Nothing has changed except installing Office 2000. I configured everything just as I had previous. Going back to Outlook Express I get the same error. What is going on? Same story here. And I would love to just be able to go back to OE at this point. Darla >-----Original Message----- >Why am I getting this right after installing Outlook 2000? >It was a gift. I have had no success trying to get info >from the knowledge base. Nothing ...

Crystal Reports not showing in 3.0
We've installed CRM 3.0 and finally got the SQL Reporting Service working. We can now click on reports without getting an error message. However, there are no reports displaying. Is there some additional setup that we need to do? I understand there is supposed to be like 150 canned reports. Where are they? Please help! Can anyone tell me how the canned reports get installed and where they are located? What database? "Barbi Dorin" wrote: > We've installed CRM 3.0 and finally got the SQL Reporting Service working. We > can now click on reports without getting an ...

windows messenger 09-24-06
have a friend's contact card popping up at any time saying they want to be added to my list. this was done a long time ago but the message keeps coming up at various times when i'm on the computer. how can i stop this?> Shirley, this is a CRM newsgroup, you may get a better response if you post in XP General group http://www.microsoft.com/smallbusiness/community/newsgroups/dgbrowser/default.mspx?dg=microsoft.public.windowsxp.general&lang=en&cr=US&r=c10a5834-ccef-4e84-9c45-1e43e21770ed "shirley" wrote: > have a friend's contact card popping up ...

Windows Office 2000 installer tries to execute everytime I compose or respond to a message
In OWA, Every time I try to compose or respond to a message, the Windows Office 2000 installer tries to execute and asks for the CD. Unfortunately, this Office 2000 problem has come up again even after all the updates to Office 2000. Also I am having trouble logging out. When I hit the logoff button, it brings up a sign-in screen asking for ID & password again. Whether I cancel it or fill it in and type OK, it then gives me a screen that says "access denied". I never get a screen which says that logout was successful. I have the same problem here... From what I've s...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

Error: Invalid byte was found at byte index 63.
Does anyone know what this means: "Invalid byte was found at byte index 63. " If yes, please help. Apogee Apogee wrote: > Does anyone know what this means: > > "Invalid byte was found at byte index 63. " That means exactly what it says: At index 63 XML parser found a byte, which is invalid either according document's encoding or is forbidden in XML documents at all (see list of allowed in XML characters at http://www.w3.org/TR/2000/REC-xml-20001006#charsets) -- Oleg Tkachenko http://www.tkachenko.com/blog Multiconn Technologies, Israel ...

Excel not Access
I have designed an Access database that holds records relating to my stores audit results going back for about 5 years plus a load more information relating to these stores. This was used to produe a pack once a month, however a change in senior management means that I have got to shelve this and prodce a similar pack in Excel. The idea would be that the user could select a month or a 12 mnth date range that would produce data that could then be used to populate a number of excel templates that have been designed. Having not used excel for years I would be grateful for any suggestion...

Password Issue with MS Money 2003
Hello, I am not familiar with newsgroups but I hope it is a forum to seek assistance. I am unable to reach MS support via email from my home computer on this issue. My Money 2003 requires a net passport password to open my account in Money that I have successfully accessed for approximately 12 months. It does not recognize my password now. I have attempted several times with my existing password, changed my net passport password, even uninstalled and re- installed MS Money 2003 to gain access to my account. Nothing has worked. Each time it states I have failed to enter the corr...

XCH Error 3092, OAB replication
I am getting error 3092 for OAB in Exchnage 2003 (migrated from 5.5) "Error 1129 occurred while processing a replication event. Folder: (3-8) NON_IPM_SUBTREE\OFFLINE ADDRESS BOOK\EX:/o" Tried to delete offilne addressbook and recreate but error has not stopped. Any help will be a great help on where to look to get rid of this issue. Thanks ...

MS Money 95 data files
I hope that some one can answer this for me. I have used MS Money 95 for years, and it works just fine for me on Windows XP, however, I now have to reformat my hard drive, and have discovered that I can nolonger find my original install disk. Will the latest versions of Money still read the MS Money 95 data files. All that I have ever used the program for is to track my investments, and am unlikely to do any different in the future. Thanks Stan B In microsoft.public.money, Stan Banner wrote: >I hope that some one can answer this for me. >I have used MS Money 95 for years, and...

Inserting form values into a table
We have a form with values taken from an sql query that comes from two different tables. We would like to enter the information into a third table. Can some one direct me to code that will do the following: 1. Provide the Insert sql that shows us how to add the form values to the table 2. Show us how to loop while inserting the information into the table (there could be several lines on the form, each must be inserted one at a time). I have worked with Access before and have never had a problem inserting information. However, I cannot quite figure out how to insert informtion through an ...

Error Generating the Offlice Address Book
I have a mixed site with 3 5.5 server and 4 2003 servers. I installed 2003 SP1 a few weeks back and since then I'm having an issue generating my Offline Address Book. Here the event log messages I'm getting. Event ID 9331: OALGen encountered error 80040107 (internal ID 501023d) accessing the public folder store while generating the offline address list for address list '/'. - Default Offline Address List For more information, click http://www.microsoft.com/contentredirect.asp. Event ID 9335: OALGen encountered error 80040107 while cleaning the offline address list public ...

Standard MFC controls behave different when showing polish characters
Hello all, I have a rather simple to describe but difficult to solve problem. Our customers want to use our ANSI MFC program to show different languages. For example Polish. When I set the font for the different controls they behave different. For example the CEdit shows the polish characters just right but the CButton with checkbox style shows glyphs instead of the special characters. Every control that is owner draw and uses for example the DrawText() function of the device context shows the characters right. I've experimented with _UNICODE for the display part and everything I could ...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

Invalid XML error when I open customization setting
I have a problem when I try to open customization setting after I import an entity. The system errored "Invalid XML" "The XML passed to the platform is not well-formed XML". Please recommend how to resolve this problem. Thanks. ...

Linker Error after upgrade from VC7.1
Hello all, After upgrading a VC7.1 project to visual studio 2005, it failed to build in the release configuration with the follwoing error : 1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined in InstallDlg.obj The debug build works fine. The project uses MFC in a static library. Well, after doing some research, it seems that this one is tied to the fact that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline functions are embedded in the .obj file. Sure there...

"MS Money 2000" mit kostenlosem HBCI-Modul (HBCIFM99) kompatibel?
Hallo, Gruppe, wollte mal fragen, ob das o. g. HBCI-Modul auch mit "MS Money 2000" (also - wenn ich das richtig verstanden habe - mit der letzten deutschen Version von "MS Money" 1999/2000 aus �sterreich/der Schweiz) kompatibel ist. Vielen Dank schon im voraus f�r Eure Hilfe. Gru� Struppi Roughly translated: ------------------------- Hello, Group, I wanted to ask whether the o. g. HBCI module also with "MS Money 2000" (also - if I understood correctly that - with the last German version of "MS Money" 1999/2000 from Austria/Switzerland) is compatib...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

Find prev record on other requeried form
Using access 2003. I have a main form for name and address info. A subform shows limited info on client placement. Click a command button on the main form and user opens another form for full screen entry of placement data. That form opens showing the client selected on the initial main form. When the full screen placement form closes, it requeries the original main form with the placement subform to show the added placement. It goes to the first record in the table though. It does not show the original client whose placement was just added. How do I set the mai...

How To Copy MS Word mailing labels into Excel
I have a word doc that I want to put into Excel. I want to add some more fields to the names and addresses. Is this simple or do I have to learn how to program? Michael Rodriguez City of Grand Prairie Michael, have you tried to copy and paste the data into excel? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Michael Rodriguez" <mrodrigu@gptx.org> wrote in messa...

How can I change 'Normal' Style for Word e-mails to 'Normal (Web)'?
Hi, I'm using Word as my e-mail editor in Outlook 2003 and want to change the default Style for e-mails from 'Normal' to 'Normal (Web)'. The problem is that new e-mails and replies in HTML format use the 'Normal' Microsoft Word 'Style', and this has no gap after paragraphs. The upshot of this is that when sending an e-mail, I have to press return twice to create a gap, but when the recipient views this, their software shows it as four gaps (the extra carriage return I typed + their correctly viewed HTML carriage return after each line). E.g. I type this: ...

error on upgrade: ID 4386
Hello, I am upgrading from DPM 2010 RC to DPM 2010 RTM, 64 bit version, on Win 2008 R2 standard. The RC is working without any issues. The upgrade scenario is supported. At the very end of the process the upgrade fails giving me the following. _____ The SQL Server installation failed because a restart was pending on this computer. Restart the computer and then start DPM Setup again. ID: 4386. Details: Unknown error (0x84be0bc2) _____ Restarting the server does not correct the issue. On the next attempt I am getting the same error message. Where to look for the pending rest...

Linking information form one worksheet to another
Hi, i have a big problem i want to create a link between some columns in two seperate worksheets, so that when i type a name on the master sheet it would give me the required information.Dont know if i explained this right, lets say on the master sheet i have columns : Name,Sex and Height on columns A,D and BH respectively i want that if i type a person's name in worksheet 2 it should give me the results on columns A,C,F in that worksheet. Please help i need it asap for my director One way .. Assuming your "master" sheet is named: Master, with data in row1 down In Shee...

McAfee 8.5.0i on access scan slows down MS Dynamics CRM web client
Our organization's McAfee 8.50i slows down MS Dynamics CRM v4 - on premise web client considerabley when loading forms and data. Besides completely disabling McAfee, does anyone know how to configure McAfee (or configure CRM) to ignore CRM related form and data loads. When disabling the oncaccess scan, or when disabling the scriptcan - it improves lookups from 8-9 seconds to 4-5 seconds. However, the organizatin policy is to have these enabled. What to do? We have the same behavior, and went we reported to Microsoft says that no solution has, then we buy and install Microsoft Securi...