Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

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

    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.
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Hi Charlotte

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

    Thanks for your response,

    John

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

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

    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:

    <pre>Public Function SetCommandLine(ByVal strNewArg As String)
    <font color=448800>'created by Charlotte Foust 10/27/2001 </font color=448800>
    Dim varCmd As Variant

    <font color=448800>'get any existing command-line argument</font color=448800>
    varCmd = Application.GetOption("command-line arguments")

    <font color=448800>'if the current value is different from the passed argument
    'change the command-line arguments setting</font color=448800>
    If varCmd <> strNewArg Then
    <font color=448800>'write a new command-line argument</font color=448800>
    Application.SetOption "command-line arguments", strNewArg
    End If 'varCmd <> strNewArg
    End Function <font color=448800>'SetCommandLine(ByVal strNewLine As String)</font color=448800></pre>

    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

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

    Sorry about that, but you did ask. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    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". <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

Posting Permissions

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