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
689 Views

Similar Articles

[PageSpeed] 42

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:

Outlook 0x800ccc0d error when Norton e-mail protect enabled: see hosts
This post is made to help others solve this issue, based on my experience. Symptom: - Outlook works perfectly well when Norton Anti-Virus e-mail protection is disabled - Outlook cannot retrieve incoming messages when NAV e-mail protection is enabled, message being: pop3 server not found, error 0x800ccc0d This symptom, and possible solutions, are exactly the object of Symantec support note: http://service1.symantec.com/SUPPORT/nav.nsf/docid/2000020716064206 Please read this note first ! The object of this post is to add another possible solution to this problem. NAV email protection sets up...

Reporting from Project Server
I dont know if i need to ask this question here or in the Access section. I have an ODBC connection to the Project Server database so I can make reports through Access. Access' limit of 255 fields per table is causing me some trouble. for example, the MSP_VIEW_PROJ_PROJECTS_ENT table has well over 255 fields. Access only shows me the first 255 fields. how can I change that so I can see all the fields in that table? thanks, Hadi Hadi, I have not tried this yet it may be a viable option. Have your DBA create a view that pulls the key fields to this table and the specifi...

"View Image Slide Show"
(Running Vista Ultimate 64-bit, SP-2, IE-8, WM-6, WLM-09, classic mode, dial-up.) In Windows Live Mail, most of the time when I receive an email with 2 or more .jpg files attached, there is an option shown as: "View Image Slide Show". Clicking on that line brings up a screen which allows me to cycle through the attached .jpg files, viewing them in sequence, going back and forth as I desire. About every 10 or so emails having some .jpg files as attachments I receive one, with several such attachments, which does NOT have the "View Image Slide Show" op...

Cannot open Outlook, keep getting Send error report of Microsoft.
We are having problems with Outlook 2003. Everytime we try to open, we get this: Send error report to Microsoft. Any ideas why? All windows and office update have been completed. ...

Savings a/c cashflow doesn't show withdrawals
Money 2003 When I do a cashflow forecast for my savings a/c it doesn't take into account transfers to my "cash" account - the one I use to keep track of what I spend my cash on. Consequently when I do the cashflow it gives an unreal projection of savings. I wish I could save $3000 in 2 months but it's not going to happen... ...

setup Windows Mail as Word 2003 default emailer
All I can do is setup Outlook. I do not use Outlook. I would like to email Word docs using MS Windows Mail (new version of Express) In the Windows Start area, type Regedit into the search bar and then start the Registry Editor and go to HKEY_CURRENT_USER>Software>Clients>Mail Right Click on the (Default) item and then on Modify and in the Value data: field enter Windows Mail so that after you click OK, you have (Default) REG_SZ WIndows Mail -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a pa...

Document Viewer installer error
I recently ran CHKDSK /F as this was prompted when I attempted to run defrag etc. Since the chkdsk was run, when I turn my PC on, I receive the following message: "document viewier - installed encountered an unexpected error - error code 2908". I click run, the same error just repeats and loops. The only was I can remove it is to end task via task manager. Any ideas how I can correct this error? many thanks ...

CSV Files and VLOOKUP error
Does anyone know why VLOOKUP and Compare formulas don't work o information originating from a CSV file? I've tried copying an pasting values only (to leave behind any formatting), but it doesn' help. Through countless tests, I've narrowed it down to the CSV file bein the only possible cause -- Message posted from http://www.ExcelForum.com Hi ajpowers, Just a guess but the imported data may have leading or trailing spaces or are numbers stored as text. You could use the formula =A1=D1 to see if you get a true or false, where A1 is the lookup value and D1 ia the CVS valu...

Uninstall of mappoint has caused errors with excel
Hi, I am running Office 2003 on the terminal server (windows 2003) and had a copy of mappoint as well. This is a mapping program. We ininstalled mappoint which has caused an error message with Excel and other office products. The error says "Cd:\documents and settings\administrator.ocrdc1\application data\microsoft\addins c:\Program files\common files\microsoft shared\geography\mpoai9.dll is not a valid add-in." I then click OK and excel opens up and everything is fine. The problem is that we are using other programs as well such as Quickbooks that export to excel and t...

How to move MS Office without reinstalling?
I have an iMac that has had Microsoft Office on it since 2002 or so. Other family members have bought MS Office as well since then. They are all v. X. Each has a unique product ID and the only disc copy I can find for installing MS Office has a key on it. I don't know if it was my original copy. I will soon be reinstalling an OS on the iMac and in the process, I will have to wipe it clean. Is it possible to copy all of the MS Office files to appropriate backup locations, then copy them back when the install is done so I do not have to reinstall from the disc and risk it not be...

explanation of codes in Visual Basic when creating User form
Hi, I am trying to create a user form in Visual Basic however I'm trying to teach myself by reading/watching tutorials. (www.contectures.o.ca, etc) A lot of the instructions I am seeing simply give the code rather than explain how to actually write one from scratch. So... I need to know what each 'term' means so I can understand how the codes work. Any help is much appreciated :) One of the first codes is for the Add button Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("PartsData") What d...

MS POS = RMS? Also, SQL Connectivity...
I'm new to MS Dynamics software, and I may be posting this in the wrong section - please let me know if I am. I have recently opened a retail store, and purchased MS Point of Sale to manage my POS functions. Is this software also called RMS? Is it a PART of RMS? From what I can find online, I cannot tell. Also, I'm interested in connecting to MS POS's MS SQL database with an external program (OSQL) to automate some SQL queries at the end of each day. Does anyone know what I use for the datebase name (master?), username (sa?), and password? I cannot seem to find any doc...

Error 550 Relaying denied
I get this nearly every time I try to send information using MS Outlook email. Any suggestions? You probably need to turn on authentication to your outgoing server. You can do so on the "Outgoing Server" tab for your mail account. -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:9cf101c3eacf$a3250cb0$a401280a@phx.gbl, Dick Brenneke wrote: > I get this nearly every time I try to send information > using MS Outlook email. Any suggestions? Th...

Unknown error from CFtpConnection::GetFile()...
Hi all, I'm having intermittent problems with CFtpConnection::GetFile()... 99% of the time GetFile() succeeds but occasionally it fails and returns FALSE with a GetLastError of 0x2EFF (12031) which I can't find documented/defined anywhere... Anyone know what this error means...? Where it is defined...? A bit of searching on on the web seems to suggest; "The connection with the server has been reset." Can anyone confirm this...? Many thanks, Andy. Andrew Kilgore wrote: > Hi all, > > I'm having intermittent problems with CFtpConnection::GetFile()... > 99%...

How to automate increasing the form cache registry/file etc...
I want to roll out a batch file to make a number of tweaks to CRM The body of it would go REGEDIT /S Kerberosefix.reg REGEDIT /S ForceFormreload.reg REGEDIT /S OutlookFix.reg It would also rename OSA.exe to OSA.bad Remove OSA.exe From the startup menu I need help finding a way to use my batch file to increase the Outlook Form cache from the default 4MB to 50 MB.. This makes CRm more stable and faster for communications. I dont want to manually do this, as it time consuming, are my end users would not be reliable in doing it themselves. I also want to make another batch file or button that...

Show date, time & day of week in one cell
Can I show the date, time and day of week in one cell. I have: 09/03/07 8:30 AM in one cell using the format (Format/Cells/Custom): [$-409]mm/dd/yy h:mm AM/PM;@ Excel refuses to accept ddd for Mon or dddd Monday at the end of the format I want it to read: 09/03/07 8:30 AM Monday in 1 cell. I have Excel 2003. One way: mm/dd/yy h:mm AM/PM dddd;@ In article <Xns99B8A3CAF9130pencilunlistedcom@208.49.82.220>, Burp <burp@beep.comINVALID> wrote: > Can I show the date, time and day of week in one cell. > > I have: > 09/03/07 8:30 AM > in one cell using the for...

Test for Windows Classic folders in XP?
Hey, I use GetVersionEx to check for XP, is there a test for Windows Classic folders in XP? Thanks, Wayne Use IsThemeActive(); Get uxtheme.h, uxtheme.lib, and uxtheme.dll by downloading Platform SDK for WIndows XP SP2 from Microsoft. Wayne "Wayne Ransier" <vsense@netcarrier.com> wrote in message news:O49wUd%23IFHA.2648@TK2MSFTNGP14.phx.gbl... > Hey, > > I use GetVersionEx to check for XP, is there a test for Windows Classic > folders in XP? > > Thanks, > Wayne > > ...

How to set "licence" for Access 2007 database?
Hi I developed an Access 2007 db to a client. Now I want to make a year based licence for that database that the client must pay if they want to continue using the database after year. It must be so that database cannot be used after this date. How I can accomplish this? Thanks! On Mon, 12 Apr 2010 13:14:17 -0700 (PDT), Sandroid <santeri.virtanen@gmail.com> wrote: >Hi > >I developed an Access 2007 db to a client. Now I want to make a year >based licence for that database that the client must pay if they want >to continue using the database after year. It mu...

I cannot get Outlook to send/receive. Error says object not found
I just installed Outlook2007. I cannot get the send/receive to work. That is when the error says Object not found. If I go to accounts and properties, I run the two tests and they complete fine. What should I try next? Outlook 2007 is the only new program, all the rest are from Office 2003 IMK <IMK@discussions.microsoft.com> wrote: > I just installed Outlook2007. I cannot get the send/receive to work. > That is when the error says Object not found. If I go to accounts and > properties, I run the two tests and they complete fine. What should I > try next? Outlook 2007 is ...

ERROR: 5.1.2 or other punctuation after the recipient's email address.
I am trying to send a email to a group address I created with 58 addresses in it. When I try to send the email to this group I get the following Error: "5.1.2 or other punctuation after the recipient's email address. " I have gone back to the original contact cards and made sure the addresses were all legal. I have re-created the list, same problem I have re-booted, same thing. Any thoughts out there? Thanks Dunc My wife and I have MBP's and are both running MS Office for Mac's, Entourage 12.2.3. Both of us have messages cued up in the out boxes th...

microsoft.public.access.conversion
...

form fields not saving to table
I have created a database with a form and three of the fields are not saving the information to the table. I have checked the row and control sources and now at a loss and thoughts? As you scroll through existing records is the data of the table displayed? Post the SQL of the query or form source. -- Build a little, test a little. "Kim" wrote: > I have created a database with a form and three of the fields are not saving > the information to the table. I have checked the row and control sources and > now at a loss and thoughts? > > ...

how do I add error bars to a 3D chart in excel?
The help states you can only add error bars to data series in 2D area. Is there a way to add them to a 3D chart? Hi, I would not have thought so. Obviously as it is not a built-in option the only way would be a work around perhaps using dummy series. Unfortunately you can create 3d combination charts. Stick with the 2d view. Cheers Andy elahe wrote: > The help states you can only add error bars to data series in 2D area. Is > there a way to add them to a 3D chart? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info I checked, and error bars are not offered for 3D ch...

SBS 2003 RWW & Windows 7 64 bit
Need help remotely connecting to 64 bit clients connected to SBS 2003 SP2. I have installed KB926505 (Vista compatabilty) on the server. When I try to establish the connection to the 64 bit machine using my 32 bit windows 7 laptop, I get a dialog box titled remote desktop disconnected. On the Windows 7 64 bit machine I have checked remote connection properties and also the advanced firewall properties, inbound connections remote connections are enabled under the domain profile. What am I missing? Thanks, So let me understand this? sorry I have a cold and it's hard for m...

Access to User Calendar
I have a user called small conference room that is used to schedule meetings on its calendar. I would like to link the calendar from our intranet site to the calendar with a UNC path. I am calling outlook: and I can get to my local mailbox and public folders but I am unable to connect to another users calendar. I am running Exchange 2003 and Outlook 2003. Is there some security modifications that need to be done? Any help is appreciated. Thanks, Steve I believe that you will need full mailbox rights. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!&...