Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2012
    Posts
    4

    Question Run-time error '2465'

    Hoping someone might be able to help me get this code right…

    Private Sub Height1_AfterUpdate()
    If ([Me.frm_subfrm_BM_Group_info.Height1.text]) < 122 _
    And ([Me.frm_subfrm_BM_Group_info.Height1.text]) > 224.5 _
    Then
    MsgBox ("Check the following conditions:" & vbCrLf & "" & vbCrLf & "Make sure the block height is greater than 122 inches!" & vbCrLf & "Make sure the block height is less than 224.5!")

    End If
    End Sub


    Just trying to get a message box to pop up after a value is entered into the textbox if the values are outside certain parameters… otherwise (if there’s no problem) I don’t want it to do anything…

    **the problem is that I get a "Run-time error '2465'...can't find the field 'l1' referred to in your expression." when I try it...

    Thoughts?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    so its VB or VBA, but aside from that what are you developing in?

    try compiling hte code and see what happens

    the message is telling you the runtime isn't happy with field '|1', and frankly Im not surprised as | is an invalid character in most variable names/control sources and so on. if you cant find it try searching for | in the code, and or go through each control and see if you can spot it.

    instead of adding an exclamation mark to the end of your error message in a msgbox you can instead use of of the icons that forms part of the message box class (off hand the constant is vbWarning). have a look at the help function for the msgbox function
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2012
    Posts
    4
    healdem - it is VBA that I am using...

    I will look again for 'l' in my code... but I couldn't see that anywhere?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    so if you can't find it in the code by using the search then its almost certainly a data/rowsource in a control
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Sep 2012
    Posts
    4
    healdem - you were right... I didn't properly call out my text box reference. Thanks for the help!

Posting Permissions

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