Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1

    Unanswered: Is it possible to capture command line params on open?

    Hey guys. I'm wondering if it's possible to capture arguments passed when calling Access via the command line. If possible, I'd like to capture an argument and use it to automatically display a given report. The displaying the report part is easy, figuring out how to allow an external application to tell access WHICH report to display is proving a bit difficult.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  2. #2
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    Interesting. Some other guy was here last week asking about that. I suggested creating a shortcut to the report (right click in Access then paste on desktop) to see what info that gives.

    What do you mean by command line? DOS prompt?

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    yeah, most likely DOS prompt. I don't really consider the "dos" prompt "dos" in anything NT+, personal habit I guess. The idea is to call it from an application written in a non-vb-friendly language.

    I was unaware you could create a shortcut that would open a specific report... I'll have to dig up that thread.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Sep 2004
    Posts
    3

    Capture command line arguments

    It is possible to do this. I have not done it in some time, but basically I email out a shortcut that has some extra text on the end and then an autoexec partitions that and uses it as input commands.

    The shortcut target is:
    "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" W:\pathname\databasename.mdb /cmd Respond_to_matter579


    The autoexec runs this function.

    Function CheckCommandLine()
    Dim Com, frm, cse As String
    Com = Command
    If Com = "" Then Exit Function
    frm = Left(Com, 17)
    cse = Right(Com, Len(Com) - 17)
    If frm = "respond_to_defect" Then
    DoCmd.OpenForm "respond_to_matter", , , , , , cse
    Else
    Exit Function
    End If
    End Function

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    Search VBA help for Command Function. It provides a sample and yet another if you highlight the word Command and hit the F1 help key.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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