If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
passing values to a function
Hi, I have this function :
Public Function open_app() Call Shell("msaccess.exe ""M:\INV\Inv_JEFF.mdb""", 1) DoCmd.Quit End Function I would like to pass a value ( the path of the mdb) Something like: Public Function open_app(the_path as String) Call Shell("msaccess.exe" the_path,1) Thank you all Bre-x |
#2
|
|||
|
|||
passing values to a function
Public Function open_app(the_path as String)
Call Shell("msaccess.exe """ & the_path & """",1) End Function That's three double quotes after msaccess.exe, and four double quotes after the_path. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Bre-x" wrote in message ... Hi, I have this function : Public Function open_app() Call Shell("msaccess.exe ""M:\INV\Inv_JEFF.mdb""", 1) DoCmd.Quit End Function I would like to pass a value ( the path of the mdb) Something like: Public Function open_app(the_path as String) Call Shell("msaccess.exe" the_path,1) Thank you all Bre-x |
#3
|
|||
|
|||
passing values to a function
Thank you, it works!!
Public Function open_app(theapp As String, thepath As String) On Error GoTo Err_open_app Dim ie As Object Select Case theapp Case "MSACCESS" Call Shell("msaccess.exe """ & thepath & """", 1) DoCmd.Quit Case "MSEXCEL" Call Shell("excel.exe """ & thepath & """", 1) DoCmd.Quit Case "MSWORD" Call Shell("word.exe """ & thepath & """", 1) DoCmd.Quit Case "IE" Set ie = CreateObject("InternetExplorer.Application") ie.AddressBar = False ie.MenuBar = True ie.Toolbar = True ie.Width = 1024 ie.Height = 768 ie.Left = 0 ie.Top = 0 ie.navigate thepath ie.resizable = True ie.Visible = True Set ie = Nothing DoCmd.Quit Case Else Responce = MsgBox("Application Error.", vbCritical, " UMCORP") Exit Function End Select Exit_open_app: Exit Function Err_open_app: MsgBox Err.Description Resume Exit_open_app End Function |
Thread Tools | |
Display Modes | |
|
|