Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 22nd, 2004, 05:01 PM
Registered User
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Add error message on calculated value.


I was wondering if there is a way to add an error message to calculated text box. What is going to happen is some values will be entered into other boxes and then the box I would like to add the error message to will calculate the average. If the average is below a certain value then an error message should pop up. The catch here is that there will be different average values selected for different orders.

I hope I have explained it well enough. Thank you
Old July 22nd, 2004, 05:53 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts

How about you do something like this on the Form_Current event:
Dim iCompare as Integer
Select Case OrderType
   Case 1   'First order type has a min Avg of 5
     iCompare = 5
   Case 2   'Second order type has a min Avg of 10
     iCompare = 5
   Case Else 
     iCompare = 0
End Select
If Me.txtAverage<iCompare Then 
    Msgbox "Average cannot be less than " & iCompare
I am a loud man with a very large hat. This means I am in charge
Old July 22nd, 2004, 11:02 PM
Registered User
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you for responding, however, I don't think that this will do. The problem is that the user inputs two variables for calculation by means of a check box and then after selecting these two things goes on to enter in anywhere from 12 to 56 different measurments. So I have figured out how to average the measurements but have not yet found a way to display a message on this average box everytime it does a calculation. I have looked in the help files and it basically says that you can't use an AfterUpdate procedure on a calculated control. I was wondering if maybe there was a way to getting text box "a" to equal text box "b" and then maybe write the code for the error message.

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
Help with an error message Shadows Beginning VB 6 1 August 27th, 2007 07:06 AM
Error Message from References to Add-ins mark@datamosaics.com Excel VBA 0 August 7th, 2006 04:27 PM
Error Message alannoble26 Excel VBA 4 November 25th, 2005 11:20 AM
Help with Error message mariakovacs Classic ASP Databases 3 October 10th, 2003 03:59 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.