Page 2 of 2 FirstFirst 12
Results 16 to 16 of 16
  1. #16
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Hi Micron

    Thanks for the PM explaining what you meant - my apologies!

    You are indeed correct that I omitted a vital line from my earlier code in post #13.


    Added in RED below and also corrected in the earlier post

    For the benefit of anyone else reading this, I've attached a very basic test database.
    There are 3 command line options: /cmd "Admin" ; /cmd/ "Settings" ; /cmd "Attendance"
    Or it can be opened with no command line switch

    It has the following code in the form load event of the startup form frmMain

    Code:
    Private Sub Form_Load()
    
    'get the command line switch used to open the app (if any)
    Dim ComLineArgs As String
    ComLineArgs = Trim(Command())
    
    Select Case ComLineArgs
    Case "Admin"
            DoCmd.Close acForm, Me.Name
            DoCmd.OpenForm "frmAdmin"
    Case "Settings"
            DoCmd.Close acForm, Me.Name
             DoCmd.OpenForm "frmSettings"
    Case "Attendance"
            DoCmd.Close acForm, Me.Name
            'run code
            UpdateAttendance
    Case Else
         'do something else
    End Select
    
    'any other code here
    
    End Sub
    The zip file includes the test app & example shortcuts (obviously the path will need updating).
    It also includes a Word doc with additional information on several Access switch options / startup conditions

    HTH
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 17
    Last Post: 02-25-2018, 02:37 AM
  2. Replies: 3
    Last Post: 03-29-2015, 07:42 PM
  3. Replies: 1
    Last Post: 09-12-2014, 06:09 AM
  4. Replies: 0
    Last Post: 04-02-2012, 11:30 AM
  5. Replies: 1
    Last Post: 01-24-2012, 12:47 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