Hi forum, absolutly new to vbscript I completed my first script by search through the forum and using copy and paste. Now, as i need a error-free version I would like to ask for comments on the script. Is it OK or is there any problematic code inside. Works find for me now, but hope to complete it as stable with your help. What I want to do? I want to open a filtered MS Access form through an other application. The parameter for the filter is send to a vbs from the origin programm: cscript.exe myfirstvbs.vbs "parameter_as_string" The content of myfirstvbs.vbs is:
quote:
Office_access_Bericht_Anzeigen ' Start des Skripts
Sub Office_access_Bericht_Anzeigen()
Dim var_flst var_flst = WScript.Arguments(0)
Dim a ' As Access.Application
Dim MyObject Dim thestring Set MyObject = GetObject("G:\my_database.mdb") If MyObject is Nothing Then MsgBox "my object is nothing" Else Set a = MyObject.Application a.automationsecurity=1 ' low 'Anzeigen If a.Visible = False Then a.Visible = True 'Formular anzeigen thestring = var_flst a.DoCmd.OpenForm "myformname", acNormal, , ("[ID_field]=" & Chr(34) & thestring & Chr(34)) 'maximize a.DoCmd.Maximize End If End Sub
What if I want to open the database exclusive? Whre to put the parameter? Any comments?