Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Presumably a Reference issue

    I have a mature source mdb file that is encountering a runtime issue when opened, in that "it" can't find the "Command" function. E.g.,

    Code:
    Public Function TMSGate()
    
        Select Case Command()
    
        Case "SermonMgr"                  'Sermon Manager running as a scheduled task
            Call SermonMgrGate
        
        Case Else
            ScrRes                        'No, get screen resolution and start TMS
        
        End Select
    
    End Function
    I commented out most of the select via debug so that only the "ScrRes" would execute and that brought me to the next function that is missing, namely the "Format" function further in the code.

    I've not messed with the References for this app in ages, though I did somewhat recently re-install Access 2003 on my new computer.

    Any ideas of what I've missed here?

    Thanks,
    Bill

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not familiar with Command() function. VBA does not recognize it when typed in the immediate window, whereas Format is recognized.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    One hint I have is that the mde files created on my "old" machine run without error. The message issued is "Can't find project or library", leaving me to believe the issue has something to do with the new computer and recent installation of A2003 plus the SP3 update.

    The Command() function is used to access parameters passed to the app when Access is launched. It's been ages, but I do seem to recall having to take some overt steps to gain access to the Command() function, certainly not the Format function.

    Hopefully, someone else will come up with an idea.

    Bill

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Interresting. I found this
    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

    Seems you got quite a bit going on with your DB. Perhaps another approach is in order if the option to access command line is not available. Could be a 64bit OS thing.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I've been on Win 7 Pro 64bit for quite some time, so I'd be surprised if there was a connection there. When my wife's computer becomes available, I'll see if the same mdb crashes on her A2003.

    I'll post back as soon as I've been able to do that.

    Bill

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Here's what I get if I attempt to create an mde file on "My" Win 7 Pro A2003 system.

    Click image for larger version. 

Name:	1-MyMach.png 
Views:	13 
Size:	13.0 KB 
ID:	15675

    And, here's what I get if I attempt to create an mde file on "My Wife's" Win 7 Pro A2003 system. (BTW, I get the same runtime error as originally posted on her computer as well.)


    Click image for larger version. 

Name:	1-KitMach.png 
Views:	13 
Size:	40.8 KB 
ID:	15676

    Below is the current References for the offending mdb file. I don't know what the issue is with the one highlighted reference.

    Click image for larger version. 

Name:	1-Ref.jpg 
Views:	14 
Size:	85.9 KB 
ID:	15677

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Rather than publishing as mde why not debug compile first. Then you can see the line of code that is causing the issue through the debugger

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    The debugger shows the error as I posted initially...............Command() The message issued is "Can't find project or library"

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The VBA was set up with reference to Outlook 11.0 Library. Now that library dll is missing. Do you have code that works with Outlook object? Uncheck the reference then run Debug Compile.

    Which version of Outlook is on the computers?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I completely forgot that I didn't include Outlook 2003 when I installed Office 2003, so that answers the missing library issue.

    However, I get the same compile Command() error on my wife's computer, which has the entire office 2003 install including Outlook.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    So it no longer errors on your computer?

    I still can't get VBA to recognize Command().
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    No no. The issue with Outlook is not involved, just turns out to be a distraction. The issue of the Command() function is persisting.

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You say this worked in runtime under Windows 7 before reinstall of 2003?

    Gaining some understanding. VBA does accept Command(). It's a function without arguments, like Date(). I was looking for intellisense popups when I typed it in the immediate window.

    I've never launched Access from the command line so just did a test with a procedure in VBA referencing the Command() function. It all works. I did not change any library references. Cannot replicate your issue. However, not tested under runtime (never used it).

    Do you see this issue in a new db file? Does your wife's Access recognize Format function? Does it happen opening under Access, not runtime?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Does it happen opening under Access, not runtime? Not sure the distinction you're making here???

    I didn't take my wife's machine beyond the Command() failure...........I'll do that in the AM.

    Also, in the AM, I'll try a new db to see if Command() fails there.

    Until Saturday AM,
    Bill

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    When you said runtime, this is what I thought of:

    "The Microsoft Office Access 2007 Runtime enables you to distribute Access 2007 applications to users who do not have the full version of Access 2007 installed on their computers."

    But I overlooked you said the file is an mdb and you are running 2003.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 22
    Last Post: 05-21-2013, 07:54 PM
  2. Add reference in MS-Access
    By kashif.special2005 in forum Access
    Replies: 1
    Last Post: 03-12-2012, 10:19 PM
  3. need help with reference..
    By dada in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:07 PM
  4. Reference to a Query
    By starhannes in forum Forms
    Replies: 5
    Last Post: 05-09-2010, 02:53 PM
  5. Combo Box Reference issue
    By Evocube in forum Forms
    Replies: 0
    Last Post: 11-09-2009, 09:04 AM

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