Command Button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zorro
    New Member
    • Sep 2007
    • 2

    #1

    Command Button

    does anyone know how to open other application through vb
    i.e:
    i create a form and at the form there is a command button.
    when i click the button, a file from ms access application will open.

    does anyone know how to do it?
    or a sample?
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #2
    Originally posted by Zorro
    does anyone know how to open other application through vb
    i.e:
    i create a form and at the form there is a command button.
    when i click the button, a file from ms access application will open.

    does anyone know how to do it?
    or a sample?
    Hello
    Try this one

    ShellExec("C:\t estfile.doc")

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      There are 2 ways to do it.. Create MSAccess Object and call the Form..

      Another way is, Shell the Application

      In ur MDB File, Create a Macro and Write Action for "OpenForm" and call the Form Name. Save the Macro say "Macro1"
      and in VB6 write this code:

      [code=vb]
      Dim RetVal
      RetVal = Shell("C:\\Prog ram Files\Microsoft Office\OFFICE\M SACCESS.EXE c:\\MyDB.mdb /x Macro1", vbMaximizedFocu s)
      [/code]

      Regards
      Veena

      Comment

      Working...