Results 1 to 5 of 5
  1. #1
    MikeVuckovic is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2019
    Posts
    2

    Exclamation dbOpenDynaset nx() and other throw errors and won't compile

    I inherited an Access database that occasionally will get corrupted on the network.


    Up until now the compact and repair function has resolved any issues.
    But a few days ago users are reporting error message of Nx() Variable not defined.
    When I try to compile the database it throws an error Variable not defined.

    Not sure where to go from here.
    Checked references for anything missing, there are none.
    Access 2013 running on Windows 10 64 bit / Windows 7 32 and 64 bit machines.

    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    why use dbOpenDynaset ?

    just open the query:
    docmd.openquery "qsMyquery"

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You may have to open a new db, save it, then import all objects into it. Then I'd check to see if
    a) OPTION EXPLICIT is at the top of every code module, and if not, add it. Google it if you are unfamiliar. I'd also set the vb editor option to "require variable declaration"
    b) keep compiling until you find and fix every non-declared variable and/or add every project reference (library) that may be missing

    I think your problem is a lot bigger than how you call a query, or don't.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    MikeVuckovic is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2019
    Posts
    2
    That's not the issue.
    This is a production database that has been around for 6 + years.
    This issue just started, for no apparent reason.
    Trying to figure out how the reserved functions and word for Access just error or won't compile?
    When running a report the Nx() function uses everywhere throughout the database throws and error, like Access doesn't know what that function is.

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    But then again, it could be the issue.... you just don't know.
    EVERY one of my dBs has these two lines at the top of every module
    Code:
    Option Compare Database
    Option Explicit
    It sounds like you have incremental corruption. I am curious.... is the db split? And each used has a COPY of the FE on their local computer?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 04-26-2018, 01:23 PM
  2. Compile Errors
    By docweaver in forum Access
    Replies: 3
    Last Post: 09-15-2017, 02:41 PM
  3. Compile Errors Not Appearing
    By MatthewR in forum Programming
    Replies: 18
    Last Post: 11-29-2016, 09:35 AM
  4. Replies: 4
    Last Post: 03-23-2015, 09:52 AM
  5. Replies: 4
    Last Post: 06-21-2014, 05:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums