• How to Update Command() within Project? (A2k (9.0.4402) SR-1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to Update Command() within Project? (A2k (9.0.4402) SR-1)

    Author
    Topic
    #361998

    How to Update Command() within Project?

    A2k (9.0.4402) SR-1

    Within the Access project, is there a way to update the Command-line arguments that gets stored in Command(), this is normally set with command line parameter /cmd when opening the database.

    Thanks, John Graves

    Viewing 0 reply threads
    Author
    Replies
    • #548902

      Nothing gets stored in Command(), that’s merely a function to return the command-line argument string. However, you can set a command-line argument from within the database itself, if that’s what you’re looking for. Just select Tools–>Options–>Advanced and you’ll see the Command-line arguments textbox. Or were you trying to do it from code? I wouldn’t recommend that unless you’re *very* careful because changing that value mid-stream could break other code calling the Command() function and expecting a different value.

      • #548928

        Hi Charlotte

        I need the syntax to set to set command-line argument string from code.

        Thanks for your response,

        John

        • #548943

          You can find examples of setting options in On-line help if you look up SetOptions, but here’s a routine that will show you that one:

          Public Function SetCommandLine(ByVal strNewArg As String)
            'created by Charlotte Foust 10/27/2001 
            Dim varCmd As Variant
            
            'get any existing command-line argument
            varCmd = Application.GetOption("command-line arguments")
            
            'if the current value is different from the passed argument
            'change the command-line arguments setting
            If varCmd  strNewArg Then
              'write a new command-line argument
              Application.SetOption "command-line arguments", strNewArg
            End If 'varCmd  strNewArg
          End Function 'SetCommandLine(ByVal strNewLine As String)
          • #549184

            Hi Charlotte

            Your reply ruined my weekend. This piece of code was my missing link that forced me to retool my startup procedures to:

            Allow users to logon to application with company and user code (/cmd or manually entered with validation), have the system isolate company, user preferences and menu system, so the system behaves appropriately based on company, user and application needs.

            There is probably a better way of accomplishing this using Security, however I

            • #549200

              Sorry about that, but you did ask. shrug

              You can find all the GetOption/SetOption arguments if you look in on-line help under “Set Options from Visual Basic”. The string for the “default field type” option is “default field type”. grin

    Viewing 0 reply threads
    Reply To: How to Update Command() within Project? (A2k (9.0.4402) SR-1)

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

    Your information: