Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    86

    Unanswered: Access Easy Validation

    Im trying to have a message box if a value in my text box is > $1000.00

    im confused where to palce the code can you help me with my code i think theres errors in it?

    thanks
    Where would i place this code?

    If Me.Text95.Value >= 1000# Then
    MsgBox "Has Reached Max benefit."
    Me.Text95.SetFocus
    End If


    thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Code:
    Private Sub SomeTextBox_AfterUpdate()
    
    If CCur(SomeTextBox.Value) >1000 then
        MsgBox "Has Reached Max benefit."
    endif
    
    End Sub
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    May 2004
    Posts
    86

    well

    when the form loads their is a value already in the text box. So where would i place this code


    If CCur(Text95.Value) > 1000 Then
    MsgBox "Has Reached Max benefit."
    End If

  4. #4
    Join Date
    Feb 2005
    Location
    Blacksburg, Virginia
    Posts
    43
    If you are using Access, you shouldn't need any explicit code to handle this. The textbox properties in design mode has Default Value, Validate, and Validate Text members built in.

    If you want to do it in code though, put the defalut value in the parent form's Form_Load Event. Or, if the value is supposed to change depending on the particular record that is displayed, but you default value in the Form_Current Event.

  5. #5
    Join Date
    May 2004
    Posts
    86

    heres the story

    I have a form and a subform. the subform has all my values with a =sum([PAID]) text box(text26). In my main form i call the subform. i have a text box on the main form called text95 that displays the total for each paid field
    based on the text26 text box in the subform

    this what i use to call the sum feild on my main form
    =[History subform3].[Form]![Text26]

    How can i get this text95 feild to display a msg box if the vaule is over 1000 when the form loads??????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •