• Compile Error (Access XP)

    • This topic has 3 replies, 4 voices, and was last updated 22 years ago.
    Author
    Topic
    #386005

    Hello all,

    1) I ran into a problem today in an mdb that has been working fine for the last week or so.

    2) I am trying to run a

    Viewing 2 reply threads
    Author
    Replies
    • #668031

      If you copied the error message literally, there is a problem with the Round function indeed, because it hasn’t been changed to proper case.

      The first thing that comes to mind is a references problem, but you state explicitly that you have already checked this.

      Another possibility is a name conflict with something else in your database. Things to check:

      • A custom function named ’round’.
      • A module named ’round’.
      • The project name (Tools/… Properties in the Visual Basic Editor)
        [/list]You can also search for round in the Object Browser in the Visual Basic Editor. The only occurrence of Round (as a whole word) in my test database is as a method of VBA.Math.
    • #670862

      I double-checked the Access 2000 help and Round( ) is a legitimate function. The only argument it requires is a numeric expression.

      My guess is that somewhere in your data there is now some “funky” data in the field [tblHRTrend]![FTE] – like a NULL value. I have recently worked through some similar problems with a custom function I had written. It “stopped working” due to changes in the underlying data that were not there when I first created the function three years ago.

      I am also curious about the format of your reference to the field within the Round function. I would have thought that Access would have inserted the square brackets around both the table name and the field name with a period as the delimiter. Since this already worked, I guess it’s not an issue. But I would double-check how you are referring to that field within the query and maybe consider changing to the other type of qualifying syntax.

      Just some thoughts.

      Peter

    • #670885

      If you are referring to a table field, get rid of the bang (!) and replace it with a dot (.) because in queries, bangs refer to form or report members while dots indicate fields.

    Viewing 2 reply threads
    Reply To: Compile Error (Access XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: