Ask Experts Questions for FREE Help !
Ask
    msuserbd's Avatar
    msuserbd Posts: 5, Reputation: 1
    New Member
     
    #1

    Aug 14, 2009, 04:17 AM
    text box validation rule on a form
    I have 2 fields on a form that if the sum of these 2 fields go over the limit I want to give the user an error message. On the 2nd field I am summing the 2 field together in the validation rule =[Runtime_minutes]+[NoWork_minutes] <>480 , but it doesn't send the error message. I have also tried to add the form to the equation and I get the object doesn't contain the automation object error. What am I doing wrong? I thought it would be a simple addition. Thanks for your help on this.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Aug 14, 2009, 06:03 AM

    First, you don't have fields on a form. You have controls that may or may not be bound to fields in a table. This is a subtle but important distinction.

    In the After Update event of the 2 text box open the Code Builder to add code like:

    If [Runtime_minutes]+[NoWork_minutes] <>480 Then
    MsgBox "Can't exceed 480", vbOkOnly
    End If
    msuserbd's Avatar
    msuserbd Posts: 5, Reputation: 1
    New Member
     
    #3

    Aug 14, 2009, 07:24 AM
    Quote Originally Posted by ScottGem View Post
    First, you don't have fields on a form. You have controls that may or may not be bound to fields in a table. This is a subtle but important distinction.

    In the After Update event of the 2 text box open the Code Builder to add code like:

    If [Runtime_minutes]+[NoWork_minutes] <>480 Then
    MsgBox "Can't exceed 480", vbOkOnly
    End If
    Thank you ! It work great, I will call them controls from now on, old habits are hard to break.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Excel 15 digit issue, tried converting to text, text to column feature negates fix [ 6 Answers ]

I have the following numbers that exceed 15 characters that needs to be split into its own columns. Down the road, there would be thousands of such rows of data with the first couple set of unique numbers. 890432453253208820,5004500558,05CC,1,0,0,0,0,0,0, 0000,5.0000,2007-01-11...

Convert image (pdf, typewriter text) to text file [ 21 Answers ]

I've played with 3 different OCR apps (including one that seems to be tops (Abbyy Fine Reader Pro) and find it too much. Easy to use but far too time consuming for my skills with it. See the attached pdf (38 pages of typed text). I have it and 5 others that need converted but am finding it too...

Javascript radio button mandatory text validation [ 1 Answers ]

Hello. Could you please help me with some javascript. In a section of my form, I want two radio buttons. When neither button is checked, an alert box will appear. If the first button is checked the form will pass. If the second button is checked, a series of mandatory text boxes are highlighted and...

How do I create a use text in the correct way but also form a shape ? [ 5 Answers ]

Crikey,its hard to explain,there must be a word for it but I don't know it... Have you ever seen a poem that actually looked to be in the shape of a bridge when written down? Or a never ending circle ? I am sure the text is also relevant to the shape... such as a stairway shape and the words...


View more questions Search